fix(SW-978): Fallback if no room is selected in URL
This commit is contained in:
@@ -61,6 +61,14 @@ export default async function SelectHotelPage({
|
|||||||
const selectHotelParams = new URLSearchParams(searchParams)
|
const selectHotelParams = new URLSearchParams(searchParams)
|
||||||
const selectHotelParamsObject =
|
const selectHotelParamsObject =
|
||||||
getHotelReservationQueryParams(selectHotelParams)
|
getHotelReservationQueryParams(selectHotelParams)
|
||||||
|
|
||||||
|
if (
|
||||||
|
!selectHotelParamsObject.room ||
|
||||||
|
selectHotelParamsObject.room.length === 0
|
||||||
|
) {
|
||||||
|
return notFound()
|
||||||
|
}
|
||||||
|
|
||||||
const adults = selectHotelParamsObject.room[0].adults // TODO: Handle multiple rooms
|
const adults = selectHotelParamsObject.room[0].adults // TODO: Handle multiple rooms
|
||||||
const children = selectHotelParamsObject.room[0].child
|
const children = selectHotelParamsObject.room[0].child
|
||||||
? generateChildrenString(selectHotelParamsObject.room[0].child)
|
? generateChildrenString(selectHotelParamsObject.room[0].child)
|
||||||
|
|||||||
Reference in New Issue
Block a user