Merged in feat/sw-3207-refactor-select-hotel-tracking (pull request #2587)

feat(SW-3207): Refactor select-hotel tracking

* Refactor select-hotel tracking


Approved-by: Bianca Widstam
This commit is contained in:
Anton Gunnarsson
2025-08-06 08:35:48 +00:00
parent 7fb082f712
commit 41efb3a7b3
9 changed files with 184 additions and 274 deletions

View File

@@ -28,11 +28,8 @@ export default async function SelectRatePage({
return notFound()
}
const { adultsInRoom, childrenInRoom, hotel, noOfRooms, bookingCode } =
searchDetails
const hotelData = await getHotel({
hotelId: hotel.id,
hotelId: searchDetails.hotel.id,
isCardOnlyPayment: false,
language: lang,
})
@@ -42,10 +39,14 @@ export default async function SelectRatePage({
}
let isInValidFNF = false
if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) {
if (
booking.bookingCode &&
FamilyAndFriendsCodes.includes(booking.bookingCode)
) {
const cookieStore = await cookies()
isInValidFNF = cookieStore.get("sc")?.value !== "1"
}
return (
<>
<HotelInfoCard booking={booking} hotel={hotelData.hotel} />
@@ -61,11 +62,8 @@ export default async function SelectRatePage({
)}
<Tracking
adultsInRoom={adultsInRoom}
childrenInRoom={childrenInRoom}
hotelId={hotel.id}
hotelName={hotel.name}
noOfRooms={noOfRooms}
hotelId={searchDetails.hotel.id}
hotelName={searchDetails.hotel.name}
country={hotelData.hotel.address.country}
city={hotelData.hotel.address.city}
/>