Allowed filters in the url
This commit is contained in:
@@ -213,17 +213,6 @@ function buildOptions(flights: Flight[]) {
|
|||||||
|
|
||||||
const availableOptions = buildOptions(props.flights)
|
const availableOptions = buildOptions(props.flights)
|
||||||
|
|
||||||
// When selected countries change, drop any selected regions that no longer
|
|
||||||
// belong to any of the selected countries.
|
|
||||||
watch(() => filters.country, (countries) => {
|
|
||||||
if (countries.length === 0) return
|
|
||||||
filters.airportRegion = filters.airportRegion.filter((regionId: number) => {
|
|
||||||
const region = availableOptions.airportRegions.find(r => r.id === regionId)
|
|
||||||
if (!region) return false
|
|
||||||
return [...region.countryCodes].some((code: string) => countries.includes(code))
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// ── URL query sync ──────────────────────────────────────────────────────────
|
// ── URL query sync ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
function loadFiltersFromQuery(): boolean {
|
function loadFiltersFromQuery(): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user