fix(2547): filter inActive hotels from booking widget
This commit is contained in:
committed by
Michael Zetterberg
parent
6a2bb5ac2d
commit
5f38a92b74
@@ -71,6 +71,13 @@ export const getDestinationsAutoCompleteRoute = safeProtectedServiceProcedure
|
||||
citiesByCountry: citiesByCountry,
|
||||
})
|
||||
|
||||
const activeLocations = locations.filter((location) => {
|
||||
return (
|
||||
location.type === "cities" ||
|
||||
(location.type === "hotels" && location.isActive)
|
||||
)
|
||||
})
|
||||
|
||||
const [hotelUrls, hotelUrlsError] = await hotelUrlsPromise
|
||||
const [cityUrls, cityUrlsError] = await cityUrlsPromise
|
||||
const [countryUrls, countryUrlsError] = await countryUrlsPromise
|
||||
@@ -86,7 +93,7 @@ export const getDestinationsAutoCompleteRoute = safeProtectedServiceProcedure
|
||||
throw new Error("Unable to fetch location URLs")
|
||||
}
|
||||
|
||||
const hotelsAndCities = locations
|
||||
const hotelsAndCities = activeLocations
|
||||
.map((location) => {
|
||||
let url: string | undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user