fix: rename children to childrenInRoom
This commit is contained in:
@@ -82,15 +82,16 @@ export default function BookingWidgetClient({
|
||||
)
|
||||
: undefined
|
||||
|
||||
const defaultRoomsData = bookingWidgetSearchData?.rooms?.map((room) => ({
|
||||
adults: room.adults,
|
||||
children: room.children ?? [],
|
||||
})) ?? [
|
||||
{
|
||||
adults: 1,
|
||||
children: [],
|
||||
},
|
||||
]
|
||||
const defaultRoomsData: BookingWidgetSchema["rooms"] =
|
||||
bookingWidgetSearchData?.rooms?.map((room) => ({
|
||||
adults: room.adults,
|
||||
childrenInRoom: room.childrenInRoom ?? [],
|
||||
})) ?? [
|
||||
{
|
||||
adults: 1,
|
||||
childrenInRoom: [],
|
||||
},
|
||||
]
|
||||
|
||||
const methods = useForm<BookingWidgetSchema>({
|
||||
defaultValues: {
|
||||
|
||||
@@ -49,8 +49,8 @@ export default function MobileToggleButton({
|
||||
return acc
|
||||
}, 0)
|
||||
const totalChildren = rooms.reduce((acc, room) => {
|
||||
if (room.children) {
|
||||
acc = acc + room.children.length
|
||||
if (room.childrenInRoom) {
|
||||
acc = acc + room.childrenInRoom.length
|
||||
}
|
||||
return acc
|
||||
}, 0)
|
||||
|
||||
Reference in New Issue
Block a user