fix: handle no children
This commit is contained in:
@@ -20,7 +20,7 @@ export type Props = {
|
||||
fromDate: Date
|
||||
toDate: Date
|
||||
adultCount: number
|
||||
childArray: Child[]
|
||||
childArray?: Child[]
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export async function RoomsContainer({
|
||||
startDate: fromDateString,
|
||||
endDate: toDateString,
|
||||
adults: adultCount,
|
||||
children: childArray.length > 0 ? childArray.length : undefined,
|
||||
children: childArray ? childArray.length : undefined,
|
||||
packageCodes: [
|
||||
RoomPackageCodeEnum.ACCESSIBILITY_ROOM,
|
||||
RoomPackageCodeEnum.PET_ROOM,
|
||||
@@ -63,7 +63,9 @@ export async function RoomsContainer({
|
||||
roomStayEndDate: toDateString,
|
||||
adults: adultCount,
|
||||
children:
|
||||
childArray.length > 0 ? generateChildrenString(childArray) : undefined,
|
||||
childArray && childArray.length > 0
|
||||
? generateChildrenString(childArray)
|
||||
: undefined,
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user