From 75a4219f3138eb02fea3c4371309299999eaae1d Mon Sep 17 00:00:00 2001 From: Linus Flood Date: Tue, 25 Feb 2025 11:17:32 +0000 Subject: [PATCH] Merged in fix/children-availability-fix-2 (pull request #1406) fix: availability - correct children string * fix: availability - correct children string Approved-by: Hrishikesh Vaipurkar --- server/routers/hotels/query.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/server/routers/hotels/query.ts b/server/routers/hotels/query.ts index 80a311c6a..3dbc1fb9e 100644 --- a/server/routers/hotels/query.ts +++ b/server/routers/hotels/query.ts @@ -14,6 +14,7 @@ import { } from "@/server/trpc" import { toApiLang } from "@/server/utils" +import { generateChildrenString } from "@/components/HotelReservation/utils" import { cache } from "@/utils/cache" import { getHotelPageUrl } from "../contentstack/hotelPage/utils" @@ -510,8 +511,8 @@ export const hotelQueryRouter = router({ adults: adultCount, ...(childArray && childArray.length > 0 && { - children: childArray.join(","), - }), + children: generateChildrenString(childArray), + }), ...(bookingCode && { bookingCode }), language: apiLang, } @@ -754,9 +755,9 @@ export const hotelQueryRouter = router({ type: matchingRoom.mainBed.type, extraBed: matchingRoom.fixedExtraBed ? { - type: matchingRoom.fixedExtraBed.type, - description: matchingRoom.fixedExtraBed.description, - } + type: matchingRoom.fixedExtraBed.type, + description: matchingRoom.fixedExtraBed.description, + } : undefined, } } @@ -1112,9 +1113,9 @@ export const hotelQueryRouter = router({ return hotelData ? { - ...hotelData, - url, - } + ...hotelData, + url, + } : null }) )