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,
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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,