Merged in feat/SW-1454-hotel-listing-city-page (pull request #1250)

feat(SW-1454): added hotel listing

* feat(SW-1454): added hotel listing


Approved-by: Fredrik Thorsson
This commit is contained in:
Erik Tiekstra
2025-02-05 13:10:28 +00:00
parent f3e6318d49
commit e3b1bfc414
27 changed files with 522 additions and 103 deletions

View File

@@ -251,16 +251,23 @@ export const packagesSchema = z
})
.transform(({ data }) => data?.attributes.packages)
export const getHotelIdsByCityIdSchema = z
export const getHotelIdsSchema = z
.object({
data: z.array(
z.object({
// We only care about the hotel id
attributes: z.object({
isPublished: z.boolean(),
}),
id: z.string(),
})
),
})
.transform((data) => data.data.map((hotel) => hotel.id))
.transform(({ data }) => {
const filteredHotels = data.filter(
(hotel) => !!hotel.attributes.isPublished
)
return filteredHotels.map((hotel) => hotel.id)
})
export const getNearbyHotelIdsSchema = z
.object({