import * as api from "../service/AdsService";
import { useQuery } from "@tanstack/react-query";

export const useGetAds = (location: string) => {
  return useQuery({
    queryKey: ["ads", location],
    queryFn: () => api.getAds(location),
    enabled: !!location,
  });
};
