feat: SW-449 Optimized code
This commit is contained in:
@@ -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()
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user