feat: consume serach params in summary and step page

This commit is contained in:
Christel Westerberg
2024-10-24 10:53:05 +02:00
parent 85fdefb5ac
commit 7954c704d9
27 changed files with 376 additions and 263 deletions

View File

@@ -1,6 +1,10 @@
import { cache } from "react"
import { Lang } from "@/constants/languages"
import {
GetRoomsAvailabilityInput,
HotelIncludeEnum,
} from "@/server/routers/hotels/input"
import { serverClient } from "../server"
@@ -53,12 +57,14 @@ export const getUserTracking = cache(async function getMemoizedUserTracking() {
export const getHotelData = cache(async function getMemoizedHotelData(
hotelId: string,
language: string,
isCardOnlyPayment?: boolean
isCardOnlyPayment?: boolean,
include?: HotelIncludeEnum[]
) {
return serverClient().hotel.hotelData.get({
hotelId,
language,
isCardOnlyPayment,
include,
})
})
@@ -71,17 +77,9 @@ export const getRoomAvailability = cache(
children,
promotionCode,
rateCode,
}: {
hotelId: string
adults: number
roomStayStartDate: string
roomStayEndDate: string
children?: string
promotionCode?: string
rateCode?: string
}) {
}: GetRoomsAvailabilityInput) {
return serverClient().hotel.availability.rooms({
hotelId: parseInt(hotelId),
hotelId,
adults,
roomStayStartDate,
roomStayEndDate,