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