fix: persist selection of bed and breakfast if same room

This commit is contained in:
Christel Westerberg
2024-12-04 16:16:32 +01:00
parent f075521421
commit 4210218852
11 changed files with 410 additions and 439 deletions

View File

@@ -547,7 +547,7 @@ export const hotelQueryRouter = router({
const hotelData = await getHotelData(
{
hotelId,
language: ctx.lang,
language: toApiLang(ctx.lang),
},
ctx.serviceToken
)
@@ -607,7 +607,11 @@ export const hotelQueryRouter = router({
const bedTypes = availableRoomsInCategory
.map((availRoom) => {
const matchingRoom = hotelData?.included
?.find((room) => room.name === availRoom.roomType)
?.find((room) =>
room.roomTypes
.map((roomType) => roomType.code)
.includes(availRoom.roomTypeCode)
)
?.roomTypes.find(
(roomType) => roomType.code === availRoom.roomTypeCode
)