Merged in fix/SW-2546-country-search (pull request #2049)
fix(SW-2546): fix country destination search * fix(SW-2546): fix url for countries Approved-by: Erik Tiekstra Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -14,6 +14,7 @@ import { getCitiesByCountry, getCountries, getLocations } from "../hotels/utils"
|
||||
import { filterAndCategorizeAutoComplete } from "./util/filterAndCategorizeAutoComplete"
|
||||
import { mapLocationToAutoCompleteLocation } from "./util/mapLocationToAutoCompleteLocation"
|
||||
|
||||
import { ApiCountry, type Country } from "@/types/enums/country"
|
||||
import type { AutoCompleteLocation } from "./schema"
|
||||
|
||||
const destinationsAutoCompleteInputSchema = z.object({
|
||||
@@ -119,7 +120,9 @@ export const getDestinationsAutoCompleteRoute = safeProtectedServiceProcedure
|
||||
|
||||
const countryAutoCompleteLocations = countries.data.map((country) => {
|
||||
const url = countryUrls.find(
|
||||
(c) => c.country && c.country === country.name
|
||||
(c) =>
|
||||
c.country &&
|
||||
ApiCountry[lang][c.country as Country] === country.name
|
||||
)?.url
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user