diff --git a/frontend/src/pages/MarketView.tsx b/frontend/src/pages/MarketView.tsx index 1c20701..e5d49ee 100644 --- a/frontend/src/pages/MarketView.tsx +++ b/frontend/src/pages/MarketView.tsx @@ -41,6 +41,7 @@ interface Hotel { notes: string | null first_seen_at: string | null last_seen_at: string | null + direct_hotel_id?: number | null } interface RateMatrixResponse { @@ -55,6 +56,7 @@ interface RateMatrixResponse { star_rating: number | null review_score: number | null booking_com_url: string | null + direct_hotel_id?: number | null }[] rates: Record { const { data: directRatesMap } = useQuery>>({ queryKey: ['market-direct-rates', fromDate, toDate], queryFn: async () => { - const compHotels = hotels.filter(h => h.tier === 'competitor' && (h as any).direct_hotel_id) + const compHotels = hotels.filter(h => h.tier === 'competitor' && h.direct_hotel_id) if (!compHotels.length) return {} const result: Record> = {} await Promise.all(compHotels.map(async h => { - const directId = (h as any).direct_hotel_id + const directId = h.direct_hotel_id! try { const res = await api.get(`/direct/hotels/${directId}/dates`, { params: { from_date: fromDate, to_date: toDate }