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
This commit is contained in:
Bianca Widstam
2025-06-19 08:08:33 +00:00
parent 1cc2bc70c1
commit 46e7f33ab6
4 changed files with 13 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ export default async function AlternativeHotelsPage(
bookingCode, bookingCode,
childrenInRoom, childrenInRoom,
city, city,
cityName, cityIdentifier,
hotel: isAlternativeFor, hotel: isAlternativeFor,
noOfRooms, noOfRooms,
redemption, redemption,
@@ -98,7 +98,7 @@ export default async function AlternativeHotelsPage(
noOfRooms, noOfRooms,
hotels?.[0]?.hotel.address.country, hotels?.[0]?.hotel.address.country,
hotels?.[0]?.hotel.address.city, hotels?.[0]?.hotel.address.city,
cityName, cityIdentifier,
bookingCode, bookingCode,
isBookingCodeRateAvailable, isBookingCodeRateAvailable,
redemption, redemption,

View File

@@ -35,7 +35,7 @@ export default async function SelectHotelPage(
bookingCode, bookingCode,
childrenInRoom, childrenInRoom,
city, city,
cityName, cityIdentifier,
noOfRooms, noOfRooms,
redemption, redemption,
} = searchDetails } = searchDetails
@@ -88,7 +88,7 @@ export default async function SelectHotelPage(
noOfRooms, noOfRooms,
hotels?.[0]?.hotel.address.country, hotels?.[0]?.hotel.address.country,
hotels?.[0]?.hotel.address.city, hotels?.[0]?.hotel.address.city,
cityName, cityIdentifier,
bookingCode, bookingCode,
isBookingCodeRateAvailable, isBookingCodeRateAvailable,
redemption, redemption,

View File

@@ -38,7 +38,7 @@ export async function SelectHotelMapContainer({
bookingCode, bookingCode,
childrenInRoom, childrenInRoom,
city, city,
cityName, cityIdentifier,
hotel: isAlternativeFor, hotel: isAlternativeFor,
noOfRooms, noOfRooms,
redemption, redemption,
@@ -90,7 +90,7 @@ export async function SelectHotelMapContainer({
noOfRooms, noOfRooms,
hotels?.[0]?.hotel.address.country, hotels?.[0]?.hotel.address.country,
hotels?.[0]?.hotel.address.city, hotels?.[0]?.hotel.address.city,
cityName, cityIdentifier,
bookingCode, bookingCode,
isBookingCodeRateAvailable, isBookingCodeRateAvailable,
redemption, redemption,

View File

@@ -24,7 +24,7 @@ interface HotelSearchDetails {
childrenInRoom: ChildrenInRoom childrenInRoom: ChildrenInRoom
childrenInRoomString: ChildrenInRoomString childrenInRoomString: ChildrenInRoomString
city: Location | null city: Location | null
cityName: string | undefined cityIdentifier: string | undefined
hotel: HotelLocation | null hotel: HotelLocation | null
noOfRooms: number noOfRooms: number
redemption?: boolean redemption?: boolean
@@ -61,15 +61,16 @@ export async function getHotelSearchDetails(
return notFound() return notFound()
} }
const cityName = isAlternativeHotels const cityIdentifier = isAlternativeHotels
? hotel?.relationships.city.name ? hotel?.relationships.city.cityIdentifier
: params.city : params.city
const city = cityName const city = cityIdentifier
? (locations.find( ? (locations.find(
(location) => (location) =>
"cityIdentifier" in location && "cityIdentifier" in location &&
location.cityIdentifier?.toLowerCase() === cityName.toLowerCase() location.cityIdentifier?.toLowerCase() ===
cityIdentifier.toLowerCase()
) ?? null) ) ?? null)
: null : null
@@ -97,7 +98,7 @@ export async function getHotelSearchDetails(
childrenInRoom, childrenInRoom,
childrenInRoomString, childrenInRoomString,
city, city,
cityName, cityIdentifier,
hotel, hotel,
noOfRooms: rooms?.length ?? 0, noOfRooms: rooms?.length ?? 0,
redemption: params.searchType === REDEMPTION, redemption: params.searchType === REDEMPTION,