base con autenticacion, registro, modulo encuestas
This commit is contained in:
14
apps/web/feactures/auth/hooks/use-mutation-users.ts
Normal file
14
apps/web/feactures/auth/hooks/use-mutation-users.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { createUserValue } from "../schemas/register";
|
||||
import { registerUserAction } from "../actions/register";
|
||||
|
||||
// Create mutation
|
||||
export function useRegisterUser() {
|
||||
const queryClient = useQueryClient();
|
||||
const mutation = useMutation({
|
||||
mutationFn: (data: createUserValue) => registerUserAction(data),
|
||||
// onSuccess: () => queryClient.invalidateQueries({ queryKey: ['users'] }),
|
||||
// onError: (e) =>
|
||||
})
|
||||
return mutation
|
||||
}
|
||||
Reference in New Issue
Block a user