fix: cache hotel response
This commit is contained in:
@@ -22,9 +22,8 @@ export default async function BookingConfirmation({
|
||||
confirmationNumber,
|
||||
}: BookingConfirmationProps) {
|
||||
const lang = getLang()
|
||||
const { booking, hotel, room } = await getBookingConfirmation(
|
||||
confirmationNumber
|
||||
)
|
||||
const { booking, hotel, room } =
|
||||
await getBookingConfirmation(confirmationNumber)
|
||||
|
||||
const arrivalDate = new Date(booking.checkInDate)
|
||||
const departureDate = new Date(booking.checkOutDate)
|
||||
|
||||
@@ -2,7 +2,7 @@ import { z } from "zod"
|
||||
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import { phoneValidator } from "@/utils/phoneValidator"
|
||||
import { phoneValidator } from "@/utils/zod/phoneValidator"
|
||||
|
||||
// stringMatcher regex is copied from current web as specified by requirements.
|
||||
const stringMatcher =
|
||||
|
||||
@@ -31,10 +31,6 @@ import {
|
||||
type TrackingSDKPageData,
|
||||
} from "@/types/components/tracking"
|
||||
|
||||
function isValidHotelData(hotel: NullableHotelData): hotel is HotelData {
|
||||
return hotel != null
|
||||
}
|
||||
|
||||
export async function SelectHotelMapContainer({
|
||||
searchParams,
|
||||
isAlternativeHotels,
|
||||
@@ -89,7 +85,7 @@ export async function SelectHotelMapContainer({
|
||||
|
||||
const [hotels] = await fetchAvailableHotelsPromise
|
||||
|
||||
const validHotels = hotels?.filter(isValidHotelData) || []
|
||||
const validHotels = (hotels?.filter(Boolean) as HotelData[]) || []
|
||||
|
||||
const hotelPins = getHotelPins(validHotels)
|
||||
const filterList = getFiltersFromHotels(validHotels)
|
||||
|
||||
@@ -66,7 +66,7 @@ export default async function HotelInfoCard({
|
||||
{
|
||||
address: hotel.address.streetAddress,
|
||||
city: hotel.address.city,
|
||||
distanceToCityCentreInKm: getSingleDecimal(
|
||||
distanceToCityCenterInKm: getSingleDecimal(
|
||||
hotel.location.distanceToCentre / 1000
|
||||
),
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
|
||||
import styles from "./selectedRoomPanel.module.css"
|
||||
|
||||
import type { Room } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { Room as SelectedRateRoom } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { Room } from "@/types/hotel"
|
||||
|
||||
interface SelectedRoomPanelProps {
|
||||
roomIndex: number
|
||||
room: Room
|
||||
roomCategories: RoomData[]
|
||||
room: SelectedRateRoom
|
||||
roomCategories: Room[]
|
||||
}
|
||||
|
||||
export default function SelectedRoomPanel({
|
||||
|
||||
Reference in New Issue
Block a user