fix: clean up hotel and its typings

This commit is contained in:
Simon Emanuelsson
2024-12-17 16:17:25 +01:00
parent ec74af8814
commit 13a164242f
110 changed files with 1931 additions and 1559 deletions

View File

@@ -1,4 +1,4 @@
import { getHotelData } from "@/lib/trpc/memoizedRequests"
import { getHotel } from "@/lib/trpc/memoizedRequests"
import { serverClient } from "@/lib/trpc/server"
import { getLang } from "@/i18n/serverContext"
@@ -73,15 +73,16 @@ async function enhanceHotels(hotels: {
const language = getLang()
const hotelFetchers = hotels.availability.map(async (hotel) => {
const hotelData = await getHotelData({
const hotelData = await getHotel({
hotelId: hotel.hotelId.toString(),
isCardOnlyPayment: false,
language,
})
if (!hotelData) return { hotelData: null, price: hotel.productType }
return {
hotelData: hotelData.data.attributes,
hotelData: hotelData.hotel,
price: hotel.productType,
}
})