Merged in fix/SW-1784-hotel-url-fetching (pull request #1450)

fix(SW-1784): Fixed issue fetching all hotel urls at once.

* fix(SW-1784): Fixed issue fetching all hotel urls at once.


Approved-by: Christian Andolf
This commit is contained in:
Erik Tiekstra
2025-03-03 06:37:55 +00:00
parent 4fc25e42b5
commit 4ad1799532
6 changed files with 125 additions and 13 deletions

View File

@@ -136,3 +136,21 @@ export const hotelPageUrlsSchema = z
}),
})
.transform(({ all_hotel_page }) => all_hotel_page.items)
export const batchedHotelPageUrlsSchema = z
.array(
z.object({
data: hotelPageUrlsSchema,
})
)
.transform((allItems) => {
return allItems.flatMap((item) => item.data)
})
export const hotelPageCountSchema = z
.object({
all_hotel_page: z.object({
total: z.number(),
}),
})
.transform(({ all_hotel_page }) => all_hotel_page.total)