fix: handle no children
This commit is contained in:
@@ -65,7 +65,7 @@ export default async function SelectRatePage({
|
|||||||
fromDate={fromDate.toDate()}
|
fromDate={fromDate.toDate()}
|
||||||
toDate={toDate.toDate()}
|
toDate={toDate.toDate()}
|
||||||
adultCount={adults}
|
adultCount={adults}
|
||||||
childArray={children ?? []}
|
childArray={children}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Suspense key={hotelId} fallback={<RoomsContainerSkeleton />}>
|
<Suspense key={hotelId} fallback={<RoomsContainerSkeleton />}>
|
||||||
@@ -75,7 +75,7 @@ export default async function SelectRatePage({
|
|||||||
fromDate={fromDate.toDate()}
|
fromDate={fromDate.toDate()}
|
||||||
toDate={toDate.toDate()}
|
toDate={toDate.toDate()}
|
||||||
adultCount={adults}
|
adultCount={adults}
|
||||||
childArray={children ?? []}
|
childArray={children}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ type Props = {
|
|||||||
hotelId: number
|
hotelId: number
|
||||||
lang: Lang
|
lang: Lang
|
||||||
adultCount: number
|
adultCount: number
|
||||||
childArray: Child[]
|
childArray?: Child[]
|
||||||
fromDate: Date
|
fromDate: Date
|
||||||
toDate: Date
|
toDate: Date
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ export async function NoRoomsAlert({
|
|||||||
roomStayStartDate: dt(fromDate).format("YYYY-MM-DD"),
|
roomStayStartDate: dt(fromDate).format("YYYY-MM-DD"),
|
||||||
roomStayEndDate: dt(toDate).format("YYYY-MM-DD"),
|
roomStayEndDate: dt(toDate).format("YYYY-MM-DD"),
|
||||||
adults: adultCount,
|
adults: adultCount,
|
||||||
children: generateChildrenString(childArray), // TODO: Handle multiple rooms,
|
children: childArray ? generateChildrenString(childArray) : undefined, // TODO: Handle multiple rooms,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Props = {
|
|||||||
fromDate: Date
|
fromDate: Date
|
||||||
toDate: Date
|
toDate: Date
|
||||||
adultCount: number
|
adultCount: number
|
||||||
childArray: Child[]
|
childArray?: Child[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function HotelInfoCard({
|
export default async function HotelInfoCard({
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export type Props = {
|
|||||||
fromDate: Date
|
fromDate: Date
|
||||||
toDate: Date
|
toDate: Date
|
||||||
adultCount: number
|
adultCount: number
|
||||||
childArray: Child[]
|
childArray?: Child[]
|
||||||
lang: Lang
|
lang: Lang
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ export async function RoomsContainer({
|
|||||||
startDate: fromDateString,
|
startDate: fromDateString,
|
||||||
endDate: toDateString,
|
endDate: toDateString,
|
||||||
adults: adultCount,
|
adults: adultCount,
|
||||||
children: childArray.length > 0 ? childArray.length : undefined,
|
children: childArray ? childArray.length : undefined,
|
||||||
packageCodes: [
|
packageCodes: [
|
||||||
RoomPackageCodeEnum.ACCESSIBILITY_ROOM,
|
RoomPackageCodeEnum.ACCESSIBILITY_ROOM,
|
||||||
RoomPackageCodeEnum.PET_ROOM,
|
RoomPackageCodeEnum.PET_ROOM,
|
||||||
@@ -63,7 +63,9 @@ export async function RoomsContainer({
|
|||||||
roomStayEndDate: toDateString,
|
roomStayEndDate: toDateString,
|
||||||
adults: adultCount,
|
adults: adultCount,
|
||||||
children:
|
children:
|
||||||
childArray.length > 0 ? generateChildrenString(childArray) : undefined,
|
childArray && childArray.length > 0
|
||||||
|
? generateChildrenString(childArray)
|
||||||
|
: undefined,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user