import { useQuery } from "react-query"; import { useHttp } from "@/hooks/useHttp"; import type { CountryCode, ILocationResponse } from "./location.services.types"; export const useCountryCodesQuery = () => { const http = useHttp("wl-booking"); const service = () => http .get>("/api/destination/countrycodes") .then((res) => res.data); return useQuery({ queryFn: service, queryKey: "country-codes", }); };