fix(2547): filter inActive hotels from booking widget
This commit is contained in:
committed by
Michael Zetterberg
parent
6a2bb5ac2d
commit
5f38a92b74
@@ -478,8 +478,7 @@ export const locationsSchema = z.object({
|
||||
)
|
||||
.transform((data) =>
|
||||
data
|
||||
.filter((node) => !!node)
|
||||
.filter((node) => !!node.isPublished)
|
||||
.filter((node) => !!node && node.isPublished)
|
||||
.filter((node) => {
|
||||
if (node.type === "hotels") {
|
||||
if (!node.operaId) {
|
||||
@@ -574,9 +573,7 @@ export const getHotelIdsSchema = z
|
||||
),
|
||||
})
|
||||
.transform(({ data }) => {
|
||||
const filteredHotels = data.filter(
|
||||
(hotel) => !!hotel.attributes.isPublished && !!hotel.attributes.isActive
|
||||
)
|
||||
const filteredHotels = data.filter((hotel) => hotel.attributes.isPublished)
|
||||
return filteredHotels.map((hotel) => hotel.id)
|
||||
})
|
||||
|
||||
@@ -594,7 +591,7 @@ export const getNearbyHotelIdsSchema = z
|
||||
})
|
||||
.transform(({ data }) => {
|
||||
const filteredHotels = data.filter(
|
||||
(hotel) => !!hotel.attributes.isPublished && !!hotel.attributes.isActive
|
||||
(hotel) => hotel.attributes.isPublished && hotel.attributes.isActive
|
||||
)
|
||||
return filteredHotels.map((hotel) => hotel.id)
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ export const locationCitySchema = z.object({
|
||||
cityIdentifier: z.string().optional(),
|
||||
keyWords: z.array(z.string()).optional(),
|
||||
name: z.string().optional().default(""),
|
||||
isPublished: z.boolean().default(false),
|
||||
isPublished: z.boolean(),
|
||||
}),
|
||||
country: z.string().optional().default(""),
|
||||
id: z.string().optional().default(""),
|
||||
|
||||
Reference in New Issue
Block a user