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
}