fix: Trimming hotel ids from contentstack to avoid 404 errors when fetching hotel data

Approved-by: Linus Flood
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-09-12 09:18:50 +00:00
parent 15a352ea99
commit ce71fc421c
5 changed files with 20 additions and 16 deletions

View File

@@ -558,7 +558,8 @@ export async function getLocations({
export const getHotel = cache(
async (input: HotelInput, serviceToken: string) => {
const { hotelId, language, isCardOnlyPayment } = input
const { language, isCardOnlyPayment } = input
const hotelId = input.hotelId.trim()
const getHotelCounter = createCounter("hotel", "getHotel")
const metricsGetHotel = getHotelCounter.init({
@@ -572,7 +573,7 @@ export const getHotel = cache(
const cacheClient = await getCacheClient()
const result = await cacheClient.cacheOrGet(
`${input.language}:hotel:${input.hotelId}:${!!input.isCardOnlyPayment}`,
`${language}:hotel:${hotelId}:${!!isCardOnlyPayment}`,
async () => {
/**
* Since API expects the params appended and not just