Merged in fix/SW-1754-overview-page-rate-limit (pull request #1412)

fix(SW-1754): Fix rate limit issue on Destination Overview Page

* fix(SW-1754): Fix rate limit issue on Destination Overview Page


Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-02-25 14:40:31 +00:00
parent 3867baadd6
commit bc50dcf286
27 changed files with 426 additions and 244 deletions
+13 -15
View File
@@ -116,25 +116,23 @@ export const hotelPageRefsSchema = z.object({
}),
})
export const hotelPageUrlSchema = z
export const hotelPageUrlsSchema = z
.object({
all_hotel_page: z.object({
items: z
.array(
z.object({
items: z.array(
z
.object({
url: z.string(),
hotel_page_id: z.string(),
system: systemSchema,
})
)
.max(1),
.transform((data) => {
return {
url: removeMultipleSlashes(`/${data.system.locale}/${data.url}`),
hotelId: data.hotel_page_id,
}
})
),
}),
})
.transform((data) => {
const page = data.all_hotel_page.items[0]
if (!page) {
return null
}
const lang = page.system.locale
return removeMultipleSlashes(`/${lang}/${page.url}`)
})
.transform(({ all_hotel_page }) => all_hotel_page.items)