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:
Matilda Landström
2025-05-13 08:48:22 +00:00
parent 81e4150cb3
commit 00f040cfbe

View File

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