import api from "../axiosInstance" // instance dosyanın yolu neyse onu düzelt
import type { DealCard } from "../../models/deal/DealCard"

export type TopRange = "day" | "week" | "month"

export async function fetchTopDeals(range: TopRange, limit = 6): Promise<DealCard[]> {
  const { data } = await api.get<DealCard[]>("/deals/top", {
    params: { range, limit },
  })
  return data
}
