Merged in feat/SW-1749-sidepeek-hotel-cta (pull request #2123)

feat(SW-1749): add link to hotel page in sidepeek

* feat(SW-1749): add link to hotel page in sidepeek


Approved-by: Matilda Landström
This commit is contained in:
Niclas Edenvin
2025-05-19 13:25:54 +00:00
parent 0554ea576e
commit fbc7366dd6
7 changed files with 50 additions and 5 deletions

View File

@@ -474,7 +474,20 @@ export const hotelQueryRouter = router({
get: serviceProcedure
.input(hotelInputSchema)
.query(async ({ ctx, input }) => {
return getHotel(input, ctx.serviceToken)
const { hotelId, language } = input
const [hotelData, hotelPages] = await Promise.all([
getHotel(input, ctx.serviceToken),
getHotelPageUrls(language),
])
const hotelPage = hotelPages.find((page) => page.hotelId === hotelId)
return hotelData
? {
...hotelData,
url: hotelPage?.url ?? null,
}
: null
}),
hotels: router({
byCountry: router({