// src/api/deal/dealApi.ts
import instance from "../axiosInstance"
import type { DealCardResponse,DealDetailResponse} from "./types"

export async function getDeals(
  page = 1
): Promise<DealCardResponse[]> {
  const { data } = await instance.get(`/deals?page=${page}`)
  return data.results
}

export async function getDealDetail(
  id: number
): Promise<DealDetailResponse> {
  const { data } = await instance.get(`/deals/${id}`)
  return data
}
