fix: rename children to childrenInRoom
This commit is contained in:
@@ -17,8 +17,8 @@ interface HotelSearchDetails<T> {
|
||||
hotel: Location | null
|
||||
selectHotelParams: T
|
||||
adultsInRoom: number
|
||||
childrenInRoom?: string
|
||||
childrenInRoomArray?: Child[]
|
||||
childrenInRoomString?: string
|
||||
childrenInRoom?: Child[]
|
||||
}
|
||||
|
||||
export async function getHotelSearchDetails<
|
||||
@@ -48,17 +48,18 @@ export async function getHotelSearchDetails<
|
||||
if (!city && !hotel) return notFound()
|
||||
|
||||
let adultsInRoom = 1
|
||||
let childrenInRoom: string | undefined = undefined
|
||||
let childrenInRoomArray: Child[] | undefined = undefined
|
||||
let childrenInRoomString: HotelSearchDetails<T>["childrenInRoomString"] =
|
||||
undefined
|
||||
let childrenInRoom: HotelSearchDetails<T>["childrenInRoom"] = undefined
|
||||
|
||||
const { rooms } = selectHotelParams
|
||||
|
||||
if (rooms && rooms.length > 0) {
|
||||
adultsInRoom = rooms[0].adults // TODO: Handle multiple rooms
|
||||
childrenInRoom = rooms[0].children
|
||||
? generateChildrenString(rooms[0].children)
|
||||
childrenInRoomString = rooms[0].childrenInRoom
|
||||
? generateChildrenString(rooms[0].childrenInRoom)
|
||||
: undefined // TODO: Handle multiple rooms
|
||||
childrenInRoomArray = rooms[0].children ? rooms[0].children : undefined // TODO: Handle multiple rooms
|
||||
childrenInRoom = rooms[0].childrenInRoom // TODO: Handle multiple rooms
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -66,7 +67,7 @@ export async function getHotelSearchDetails<
|
||||
hotel: hotel ?? null,
|
||||
selectHotelParams,
|
||||
adultsInRoom,
|
||||
childrenInRoomString,
|
||||
childrenInRoom,
|
||||
childrenInRoomArray,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user