From 494bf2ba78191af538f35fb5147d217e2971dd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20J=C3=A4derberg?= Date: Mon, 15 Dec 2025 13:19:05 +0000 Subject: [PATCH] Merged in fix/BOOK-672-hotels-without-related-links (pull request #3348) fix(BOOK-672): remove unused relationsships that threw when missing * fix(BOOK-672): remove unused relationsships that threw when missing Approved-by: Linus Flood --- .vscode/launch.json | 7 +++++++ packages/trpc/lib/routers/hotels/output.ts | 7 +------ packages/trpc/lib/routers/hotels/schemas/hotel.ts | 13 ------------- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 918b3e6d8..4ddfe9d04 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,13 @@ { "version": "0.2.0", "configurations": [ + { + "name": "Attach", + "port": 9229, + "request": "attach", + "skipFiles": ["/**"], + "type": "node" + }, { "name": "Web", "type": "node", diff --git a/packages/trpc/lib/routers/hotels/output.ts b/packages/trpc/lib/routers/hotels/output.ts index 71a48859e..11e0a5f70 100644 --- a/packages/trpc/lib/routers/hotels/output.ts +++ b/packages/trpc/lib/routers/hotels/output.ts @@ -18,11 +18,7 @@ import { sortRoomConfigs } from "../../utils/sortRoomConfigs" import { occupancySchema } from "./schemas/availability/occupancy" import { productTypeSchema } from "./schemas/availability/productType" import { citySchema } from "./schemas/city" -import { - attributesSchema, - includedSchema, - relationshipsSchema as hotelRelationshipsSchema, -} from "./schemas/hotel" +import { attributesSchema, includedSchema } from "./schemas/hotel" import { addressSchema } from "./schemas/hotel/address" import { detailedFacilitiesSchema } from "./schemas/hotel/detailedFacility" import { locationSchema } from "./schemas/hotel/location" @@ -54,7 +50,6 @@ export const hotelSchema = z } return lang }), - relationships: hotelRelationshipsSchema, type: z.literal("hotels"), // No enum here but the standard return appears to be "hotels". }), // NOTE: We can pass an "include" param to the hotel API to retrieve diff --git a/packages/trpc/lib/routers/hotels/schemas/hotel.ts b/packages/trpc/lib/routers/hotels/schemas/hotel.ts index e537ffb84..335a5933b 100644 --- a/packages/trpc/lib/routers/hotels/schemas/hotel.ts +++ b/packages/trpc/lib/routers/hotels/schemas/hotel.ts @@ -69,16 +69,3 @@ export const includedSchema = z return false }) ) - -const relationshipSchema = z.object({ - links: z.object({ - related: z.string(), - }), -}) - -export const relationshipsSchema = z.object({ - meetingRooms: relationshipSchema, - nearbyHotels: relationshipSchema, - restaurants: relationshipSchema, - roomCategories: relationshipSchema, -})