fixed issue where city and hotel is undefined or null
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { notFound } from "next/navigation"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import SelectHotel from "@/components/HotelReservation/SelectHotel"
|
||||
@@ -15,9 +16,11 @@ export default async function SelectHotelPage({
|
||||
}: PageArgs<LangParams, SelectHotelSearchParams>) {
|
||||
setLang(params.lang)
|
||||
const searchDetails = await getHotelSearchDetails({ searchParams })
|
||||
if (!searchDetails) return null
|
||||
if (!searchDetails) return notFound()
|
||||
const { city, urlSearchParams, adultsInRoom, childrenInRoom } = searchDetails
|
||||
|
||||
if (!city) return notFound()
|
||||
|
||||
const reservationParams = {
|
||||
selectHotelParams: urlSearchParams,
|
||||
searchParams,
|
||||
|
||||
Reference in New Issue
Block a user