fix: cache hotel response
This commit is contained in:
@@ -12,8 +12,6 @@ export default async function BookingConfirmationPage({
|
||||
setLang(params.lang)
|
||||
void getBookingConfirmation(searchParams.confirmationNumber)
|
||||
return (
|
||||
<BookingConfirmation
|
||||
confirmationNumber={searchParams.confirmationNumber}
|
||||
/>
|
||||
<BookingConfirmation confirmationNumber={searchParams.confirmationNumber} />
|
||||
)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
CategorizedFilters,
|
||||
Filter,
|
||||
} from "@/types/components/hotelReservation/selectHotel/hotelFilters"
|
||||
import type { HotelsAvailabilityItem } from "@/server/routers/hotels/output"
|
||||
import type { HotelsAvailabilityItem } from "@/types/trpc/routers/hotel/availability"
|
||||
|
||||
const hotelSurroundingsFilterNames = [
|
||||
"Hotel surroundings",
|
||||
|
||||
@@ -28,14 +28,11 @@ export default async function SelectRatePage({
|
||||
}: PageArgs<LangParams & { section: string }, SelectRateSearchParams>) {
|
||||
setLang(params.lang)
|
||||
const searchDetails = await getHotelSearchDetails({ searchParams })
|
||||
if (!searchDetails) {
|
||||
return notFound()
|
||||
}
|
||||
const { hotel, adultsInRoom, childrenInRoom, selectHotelParams } = searchDetails
|
||||
|
||||
if (!hotel) {
|
||||
if (!searchDetails?.hotel) {
|
||||
return notFound()
|
||||
}
|
||||
const { hotel, adultsInRoom, childrenInRoom, selectHotelParams } =
|
||||
searchDetails
|
||||
|
||||
const hotelData = await getHotel({
|
||||
hotelId: hotel.id,
|
||||
|
||||
@@ -27,8 +27,8 @@ export default async function BookingWidgetPage({
|
||||
})
|
||||
|
||||
const hotelPageParams = {
|
||||
hotel: hotelData?.data?.id || "",
|
||||
city: hotelData?.data?.attributes?.cityName || "",
|
||||
hotel: hotelData?.hotel?.id || "",
|
||||
city: hotelData?.hotel?.cityName || "",
|
||||
}
|
||||
|
||||
return <BookingWidget bookingWidgetSearchParams={hotelPageParams} />
|
||||
|
||||
Reference in New Issue
Block a user