HotTRDealsFrontend/src/api/deal/getDeal.ts
2025-11-05 14:55:26 +00:00

23 lines
512 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// src/api/deal/dealApi.ts
import instance from "../axiosInstance"
export async function getDeals(page = 1) {
try {
const { data } = await instance.get(`/deals?page=${page}`)
return data.results
} catch (error) {
console.error("Deal listesi hatası:", error)
throw error
}
}
export async function getDeal(id: number) {
try {
const { data } = await instance.get(`/deals/${id}`)
return data
} catch (error) {
console.error("Deal alma hatası:", error)
throw error
}
}