From 46e7f33ab61cf01d8c235240f067020bfbfcb4a8 Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Thu, 19 Jun 2025 08:08:33 +0000 Subject: [PATCH] Merged in fix/SW-3083-alternative-hotels-page-not-found (pull request #2396) fix(SW-3083): alternative hotels compare locations with cityIdentifier * fix(SW-3083): alternative hotels compare locations with cityIdentifier * fix(SW-3083): rename cityName * fix(SW-3083): rename to cityIdentifier Approved-by: Anton Gunnarsson --- .../(standard)/alternative-hotels/page.tsx | 4 ++-- .../(standard)/select-hotel/page.tsx | 4 ++-- .../SelectHotelMap/SelectHotelMapContainer.tsx | 4 ++-- apps/scandic-web/utils/hotelSearchDetails.ts | 13 +++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx index 8d075b715..ca0d50e4c 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx @@ -42,7 +42,7 @@ export default async function AlternativeHotelsPage( bookingCode, childrenInRoom, city, - cityName, + cityIdentifier, hotel: isAlternativeFor, noOfRooms, redemption, @@ -98,7 +98,7 @@ export default async function AlternativeHotelsPage( noOfRooms, hotels?.[0]?.hotel.address.country, hotels?.[0]?.hotel.address.city, - cityName, + cityIdentifier, bookingCode, isBookingCodeRateAvailable, redemption, diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx index bf864e907..d7accb6f0 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx @@ -35,7 +35,7 @@ export default async function SelectHotelPage( bookingCode, childrenInRoom, city, - cityName, + cityIdentifier, noOfRooms, redemption, } = searchDetails @@ -88,7 +88,7 @@ export default async function SelectHotelPage( noOfRooms, hotels?.[0]?.hotel.address.country, hotels?.[0]?.hotel.address.city, - cityName, + cityIdentifier, bookingCode, isBookingCodeRateAvailable, redemption, diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx index f0102d919..8fc99701b 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer.tsx @@ -38,7 +38,7 @@ export async function SelectHotelMapContainer({ bookingCode, childrenInRoom, city, - cityName, + cityIdentifier, hotel: isAlternativeFor, noOfRooms, redemption, @@ -90,7 +90,7 @@ export async function SelectHotelMapContainer({ noOfRooms, hotels?.[0]?.hotel.address.country, hotels?.[0]?.hotel.address.city, - cityName, + cityIdentifier, bookingCode, isBookingCodeRateAvailable, redemption, diff --git a/apps/scandic-web/utils/hotelSearchDetails.ts b/apps/scandic-web/utils/hotelSearchDetails.ts index 946a4afb4..a3c292c30 100644 --- a/apps/scandic-web/utils/hotelSearchDetails.ts +++ b/apps/scandic-web/utils/hotelSearchDetails.ts @@ -24,7 +24,7 @@ interface HotelSearchDetails { childrenInRoom: ChildrenInRoom childrenInRoomString: ChildrenInRoomString city: Location | null - cityName: string | undefined + cityIdentifier: string | undefined hotel: HotelLocation | null noOfRooms: number redemption?: boolean @@ -61,15 +61,16 @@ export async function getHotelSearchDetails( return notFound() } - const cityName = isAlternativeHotels - ? hotel?.relationships.city.name + const cityIdentifier = isAlternativeHotels + ? hotel?.relationships.city.cityIdentifier : params.city - const city = cityName + const city = cityIdentifier ? (locations.find( (location) => "cityIdentifier" in location && - location.cityIdentifier?.toLowerCase() === cityName.toLowerCase() + location.cityIdentifier?.toLowerCase() === + cityIdentifier.toLowerCase() ) ?? null) : null @@ -97,7 +98,7 @@ export async function getHotelSearchDetails( childrenInRoom, childrenInRoomString, city, - cityName, + cityIdentifier, hotel, noOfRooms: rooms?.length ?? 0, redemption: params.searchType === REDEMPTION,