mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Fix deleting a user shows User not found toast error (#41339)
This commit is contained in:
1 parent
3dfb7ace25
commit
34b5e0bf07
2 files changed
+3
-3
No files matched your search
@@ -236,8 +236,8 @@ export const UsersV2 = () => {
|
||||
|
||||
const { setValue: setSelectedUser, value: selectedUser } = useQueryStateWithSelect({
|
||||
urlKey: 'show',
|
||||
enabled: users.length > 0 && isSuccess,
|
||||
select: (id: string) => (id ? users?.find((u) => u.id === id)?.id : undefined),
|
||||
enabled: !!users && !isLoading,
|
||||
onError: () => toast.error(`User not found`),
|
||||
})
|
||||
|
||||
|
||||
@@ -36,13 +36,13 @@ export const useUserDeleteMutation = ({
|
||||
async onSuccess(data, variables, context) {
|
||||
const { projectRef, skipInvalidation = false } = variables
|
||||
|
||||
await onSuccess?.(data, variables, context)
|
||||
|
||||
if (!skipInvalidation) {
|
||||
await Promise.all([
|
||||
queryClient.invalidateQueries({ queryKey: authKeys.usersInfinite(projectRef) }),
|
||||
])
|
||||
}
|
||||
|
||||
await onSuccess?.(data, variables, context)
|
||||
},
|
||||
async onError(data, variables, context) {
|
||||
if (onError === undefined) {
|
||||
|
||||
Reference in new issue
Block a user