From 6a2bb5ac2defb8bcc4e754e7cc2fa0bdd0c9a7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Tue, 6 May 2025 11:00:45 +0200 Subject: [PATCH] fix(SW-2547): filter out cities and hotel with isPublished=false --- apps/scandic-web/server/routers/hotels/output.ts | 1 + apps/scandic-web/server/routers/hotels/schemas/location/city.ts | 1 + .../scandic-web/server/routers/hotels/schemas/location/hotel.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/apps/scandic-web/server/routers/hotels/output.ts b/apps/scandic-web/server/routers/hotels/output.ts index ea7090fcb..af918adc3 100644 --- a/apps/scandic-web/server/routers/hotels/output.ts +++ b/apps/scandic-web/server/routers/hotels/output.ts @@ -479,6 +479,7 @@ export const locationsSchema = z.object({ .transform((data) => data .filter((node) => !!node) + .filter((node) => !!node.isPublished) .filter((node) => { if (node.type === "hotels") { if (!node.operaId) { 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 dc3404f31..0f55a6f99 100644 --- a/apps/scandic-web/server/routers/hotels/schemas/location/city.ts +++ b/apps/scandic-web/server/routers/hotels/schemas/location/city.ts @@ -5,6 +5,7 @@ export const locationCitySchema = z.object({ cityIdentifier: z.string().optional(), keyWords: z.array(z.string()).optional(), name: z.string().optional().default(""), + isPublished: z.boolean().default(false), }), country: z.string().optional().default(""), id: z.string().optional().default(""), diff --git a/apps/scandic-web/server/routers/hotels/schemas/location/hotel.ts b/apps/scandic-web/server/routers/hotels/schemas/location/hotel.ts index df28c4932..6dd162c36 100644 --- a/apps/scandic-web/server/routers/hotels/schemas/location/hotel.ts +++ b/apps/scandic-web/server/routers/hotels/schemas/location/hotel.ts @@ -11,6 +11,8 @@ export const locationHotelSchema = z.object({ tiny: z.string().optional(), }) .optional(), + isActive: z.boolean(), + isPublished: z.boolean(), keyWords: z.array(z.string()).optional(), name: z.string().optional().default(""), operaId: z.coerce.string().optional(),