fix: rename children to childrenInRoom

This commit is contained in:
Christel Westerberg
2025-01-14 12:25:17 +01:00
parent b2935114e3
commit bcae63e3fc
26 changed files with 104 additions and 91 deletions

View File

@@ -29,7 +29,7 @@ export default async function SelectRatePage({
setLang(params.lang)
const searchDetails = await getHotelSearchDetails({ searchParams })
if (!searchDetails) return notFound()
const { hotel, adultsInRoom, childrenInRoomArray, selectHotelParams } =
const { hotel, adultsInRoom, childrenInRoom, selectHotelParams } =
searchDetails
if (!hotel) return notFound()
@@ -62,9 +62,9 @@ export default async function SelectRatePage({
arrivalDate: format(arrivalDate, "yyyy-MM-dd"),
departureDate: format(departureDate, "yyyy-MM-dd"),
noOfAdults: adultsInRoom,
noOfChildren: childrenInRoomArray?.length,
ageOfChildren: childrenInRoomArray?.map((c) => c.age).join(","),
childBedPreference: childrenInRoomArray
noOfChildren: childrenInRoom?.length,
ageOfChildren: childrenInRoom?.map((c) => c.age).join(","),
childBedPreference: childrenInRoom
?.map((c) => ChildBedMapEnum[c.bed])
.join("|"),
noOfRooms: 1, // // TODO: Handle multiple rooms
@@ -88,7 +88,7 @@ export default async function SelectRatePage({
fromDate={fromDate.toDate()}
toDate={toDate.toDate()}
adultCount={adultsInRoom}
childArray={childrenInRoomArray}
childArray={childrenInRoom}
/>
<Suspense key={hotelId} fallback={<RoomsContainerSkeleton />}>
@@ -98,7 +98,7 @@ export default async function SelectRatePage({
fromDate={fromDate.toDate()}
toDate={toDate.toDate()}
adultCount={adultsInRoom}
childArray={childrenInRoomArray}
childArray={childrenInRoom}
/>
</Suspense>
<Suspense fallback={null}>