feat(BOOK-56): Added content related to destination filters
Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
} from "@scandic-hotels/trpc/types/hotel"
|
||||
|
||||
import type { DestinationCityListItem } from "@scandic-hotels/trpc/types/destinationCityPage"
|
||||
import type { DestinationFilter } from "@scandic-hotels/trpc/types/destinationsData"
|
||||
|
||||
const HOTEL_SORTING_STRATEGIES: Partial<
|
||||
Record<
|
||||
@@ -85,3 +86,13 @@ export function getBasePathNameWithoutFilters(
|
||||
|
||||
return pathname
|
||||
}
|
||||
|
||||
export function getActiveDestinationFilter(
|
||||
filterFromUrl: HotelFilter | null,
|
||||
allSeoFilters: DestinationFilter[]
|
||||
) {
|
||||
if (!filterFromUrl) {
|
||||
return null
|
||||
}
|
||||
return allSeoFilters.find((f) => f.filter.id === filterFromUrl.id) || null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user