import { OtpValidationRequestModel, validateOtp } from "@/lib/api/auth/validate-otp"
import { useQueryClient } from "@tanstack/react-query"

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

  const run = (model: OtpValidationRequestModel) =>
    queryClient.fetchQuery({
      queryKey: ['requestOtpValidation', model],
      queryFn: () => validateOtp(model),
    })

  return { run }
}
