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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user