import { requestOtp } from "@/lib/api/auth/request-otp"
import { useQueryClient } from "@tanstack/react-query"

export const useOtpRequest = () => {
  const queryClient = useQueryClient()

  const run = (phone: string) =>
    queryClient.fetchQuery({
      queryKey: ['requestOtp', phone],
      queryFn: () => requestOtp({ phone }),
    })

  return { run }
}
