fix(SW-614): move filtering logic to routes

This commit is contained in:
Tobias Johansson
2024-10-28 11:06:47 +01:00
parent 7819db2bb2
commit 60ceeaf9c3
5 changed files with 52 additions and 20 deletions

View File

@@ -52,23 +52,34 @@ export const getUserTracking = cache(async function getMemoizedUserTracking() {
export const getHotelData = cache(async function getMemoizedHotelData(
hotelId: string,
language: string
language: string,
isCardOnlyPayment?: boolean
) {
return serverClient().hotel.hotelData.get({
hotelId,
language,
isCardOnlyPayment,
})
})
export const getRoomAvailability = cache(
async function getMemoizedRoomAvailability(
hotelId: string,
adults: number,
roomStayStartDate: string,
roomStayEndDate: string,
children?: number,
async function getMemoizedRoomAvailability({
hotelId,
adults,
roomStayStartDate,
roomStayEndDate,
children,
promotionCode,
rateCode,
}: {
hotelId: string
adults: number
roomStayStartDate: string
roomStayEndDate: string
children?: number
promotionCode?: string
) {
rateCode?: string
}) {
return serverClient().hotel.availability.rooms({
hotelId: parseInt(hotelId),
adults,
@@ -76,6 +87,7 @@ export const getRoomAvailability = cache(
roomStayEndDate,
children,
promotionCode,
rateCode,
})
}
)