diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/[step]/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/[step]/page.tsx index 7532c6673..264f5b04d 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/[step]/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/[step]/page.tsx @@ -22,12 +22,6 @@ import type { LangParams, PageArgs } from "@/types/params" export function preload() { void getProfileSafely() void getCreditCardsSafely() - void getRoomAvailability({ - hotelId: "811", - adults: 1, - roomStayStartDate: "2024-11-01", - roomStayEndDate: "2024-11-02", - }) } function isValidStep(step: string): step is StepEnum { @@ -42,6 +36,12 @@ export default async function StepPage({ redirect(`/${params.lang}`) } void getBreakfastPackages(searchParams.hotel) + void getRoomAvailability({ + hotelId: searchParams.hotel, + adults: Number(searchParams.adults), + roomStayStartDate: searchParams.checkIn, + roomStayEndDate: searchParams.checkOut, + }) const intl = await getIntl() @@ -55,13 +55,14 @@ export default async function StepPage({ adults: Number(searchParams.adults), roomStayStartDate: searchParams.checkIn, roomStayEndDate: searchParams.checkOut, + rateCode: searchParams.rateCode, }) if (!isValidStep(params.step) || !hotel || !roomAvailability) { return notFound() } - const mustBeGuaranteed = false + const mustBeGuaranteed = roomAvailability?.mustBeGuaranteed ?? false const paymentGuarantee = intl.formatMessage({ id: "Payment Guarantee",