Merged in fix/unify-gethotel-input (pull request #1319)

feat: getHotel - unify input to make sure we can use the same cache response

* feat: getHotel - unify input to make sure we can use the same cache response


Approved-by: Simon.Emanuelsson
This commit is contained in:
Linus Flood
2025-02-12 11:35:39 +00:00
parent ea9d68a191
commit 019a5db549
5 changed files with 8 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ export default async function BookingWidgetPage({
const hotelData = await getHotel({
hotelId: hotelPageData?.hotel_page_id || "",
language: getLang(),
isCardOnlyPayment: false,
})
const hotelPageParams = {

View File

@@ -31,7 +31,7 @@ export default async function HotelSubpage({
const [intl, hotelPageData, hotelData] = await Promise.all([
getIntl(),
getHotelPage(),
getHotel({ hotelId, language: lang }),
getHotel({ hotelId, language: lang, isCardOnlyPayment: false }),
])
if (!hotelData?.hotel || !hotelPageData) {

View File

@@ -23,6 +23,7 @@ export default function HotelReservationSidePeek({
{
hotelId: hotelId ?? "",
language: lang,
isCardOnlyPayment: false,
},
{
enabled: !!hotelId,

View File

@@ -59,7 +59,7 @@ export const ratesInputSchema = z.object({
export const hotelInputSchema = z.object({
hotelId: z.string(),
isCardOnlyPayment: z.boolean().default(false),
isCardOnlyPayment: z.boolean(),
language: z.nativeEnum(Lang),
})

View File

@@ -493,7 +493,10 @@ export async function getHotelListData(
const hotels = await Promise.all(
hotelIds.map(async (hotelId) => {
const [hotelData, url] = await Promise.all([
getHotel({ hotelId, language: lang }, serviceToken),
getHotel(
{ hotelId, language: lang, isCardOnlyPayment: false },
serviceToken
),
getHotelPageUrl(lang, hotelId),
])