From 12ef42dcd339d3753e722a14d63e5f960b8d924e Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Wed, 16 Oct 2024 14:10:24 +0200 Subject: [PATCH] feat: SW-449 Optimized code --- components/Forms/BookingWidget/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/Forms/BookingWidget/index.tsx b/components/Forms/BookingWidget/index.tsx index ade125cdc..270a38b04 100644 --- a/components/Forms/BookingWidget/index.tsx +++ b/components/Forms/BookingWidget/index.tsx @@ -40,16 +40,16 @@ export default function Form({ locations, type }: BookingWidgetFormProps) { else bookingWidgetParams.set("hotel", locationData.operaId || "") data.rooms.forEach((room, index) => { - bookingWidgetParams.set(`room[${index}].adults`, `${room.adults}`) + bookingWidgetParams.set(`room[${index}].adults`, room.adults.toString()) - room.children.map((child, childIndex) => { + room.children.forEach((child, childIndex) => { bookingWidgetParams.set( `room[${index}].child[${childIndex}].age`, - `${child.age}` + child.age.toString() ) bookingWidgetParams.set( `room[${index}].child[${childIndex}].bed`, - `${child.bed}` + child.bed.toString() ) }) })