import instance from "../axiosInstance"

export async function searchDeals(query: string, page = 1) {
  try {
    const { data } = await instance.get(`/deals/search`, {
      params: { q: query, page },
    })
    // backend response { results, total, totalPages } formatındaysa:
    return data.results
  } catch (error) {
    console.error("Deal arama hatası:", error)
    throw error
  }
}
