fix(2547): filter inActive hotels from booking widget

This commit is contained in:
Matilda Landström
2025-05-06 11:21:42 +02:00
committed by Michael Zetterberg
parent 6a2bb5ac2d
commit 5f38a92b74
3 changed files with 12 additions and 8 deletions

View File

@@ -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