feat(SW-717) Multiple requests if adult differ between rooms
This commit is contained in:
@@ -23,7 +23,7 @@ interface HotelSearchDetails<T> {
|
||||
city: Location | null
|
||||
hotel: HotelLocation | null
|
||||
selectHotelParams: SelectHotelParams<T> & { city: string | undefined }
|
||||
adultsInRoom: number
|
||||
adultsInRoom: number[]
|
||||
childrenInRoomString?: string
|
||||
childrenInRoom?: Child[]
|
||||
}
|
||||
@@ -79,7 +79,7 @@ export async function getHotelSearchDetails<
|
||||
if (!city && !hotel) return notFound()
|
||||
if (isAlternativeHotels && (!city || !hotel)) return notFound()
|
||||
|
||||
let adultsInRoom = 1
|
||||
let adultsInRoom: number[] = []
|
||||
let childrenInRoomString: HotelSearchDetails<T>["childrenInRoomString"] =
|
||||
undefined
|
||||
let childrenInRoom: HotelSearchDetails<T>["childrenInRoom"] = undefined
|
||||
@@ -87,7 +87,7 @@ export async function getHotelSearchDetails<
|
||||
const { rooms } = selectHotelParams
|
||||
|
||||
if (rooms && rooms.length > 0) {
|
||||
adultsInRoom = rooms[0].adults // TODO: Handle multiple rooms
|
||||
adultsInRoom = rooms.map((room) => room.adults?.[0] ?? 0)
|
||||
childrenInRoomString = rooms[0].childrenInRoom
|
||||
? generateChildrenString(rooms[0].childrenInRoom)
|
||||
: undefined // TODO: Handle multiple rooms
|
||||
|
||||
Reference in New Issue
Block a user