From 42701739a0a102cfc9c8ad5674251449e48665df Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 28 May 2025 08:45:03 +0000 Subject: [PATCH] Merged in fix/SW-2921-countryName (pull request #2249) fix(SW-2921): Moved countryName to attributes in locations schema * fix(SW-2921): Moved countryName to attributes in locations schema Approved-by: Linus Flood --- apps/scandic-web/server/routers/hotels/output.ts | 2 +- apps/scandic-web/server/routers/hotels/schemas/location/city.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/scandic-web/server/routers/hotels/output.ts b/apps/scandic-web/server/routers/hotels/output.ts index ff90c706c..18987dc77 100644 --- a/apps/scandic-web/server/routers/hotels/output.ts +++ b/apps/scandic-web/server/routers/hotels/output.ts @@ -440,7 +440,7 @@ export const locationsSchema = z.object({ if (location.type === "cities") { return { ...location.attributes, - country: location?.countryName || "", + country: location.attributes.countryName || "", id: location.id, type: location.type, } diff --git a/apps/scandic-web/server/routers/hotels/schemas/location/city.ts b/apps/scandic-web/server/routers/hotels/schemas/location/city.ts index be8753edc..47c06f980 100644 --- a/apps/scandic-web/server/routers/hotels/schemas/location/city.ts +++ b/apps/scandic-web/server/routers/hotels/schemas/location/city.ts @@ -5,9 +5,9 @@ export const locationCitySchema = z.object({ cityIdentifier: z.string().optional(), keyWords: z.array(z.string()).optional(), name: z.string().optional().default(""), + countryName: z.string().optional().default(""), isPublished: z.boolean(), }), - countryName: z.string().optional().default(""), id: z.string().optional().default(""), type: z.literal("cities"), })