From 00f040cfbee9fd1e002a495e1c8dfca4d770a3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Tue, 13 May 2025 08:48:22 +0000 Subject: [PATCH] Merged in fix/SW-2546-country-search (pull request #2049) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(SW-2546): fix country destination search * fix(SW-2546): fix url for countries Approved-by: Erik Tiekstra Approved-by: Joakim Jäderberg --- apps/scandic-web/server/routers/autocomplete/destinations.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/scandic-web/server/routers/autocomplete/destinations.ts b/apps/scandic-web/server/routers/autocomplete/destinations.ts index 0020cdf98..064d6553b 100644 --- a/apps/scandic-web/server/routers/autocomplete/destinations.ts +++ b/apps/scandic-web/server/routers/autocomplete/destinations.ts @@ -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 {