feat: SW-1583 Implemented Reward nights on city search
This commit is contained in:
@@ -36,8 +36,9 @@ const hotelFacilitiesFilterNames = [
|
||||
export async function fetchAvailableHotels(
|
||||
input: AvailabilityInput
|
||||
): Promise<NullableHotelData[]> {
|
||||
const availableHotels =
|
||||
await serverClient().hotel.availability.hotelsByCity(input)
|
||||
const availableHotels = input.redemption
|
||||
? await serverClient().hotel.availability.hotelsByCityWithRedemption(input)
|
||||
: await serverClient().hotel.availability.hotelsByCity(input)
|
||||
|
||||
if (!availableHotels) return []
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ interface HotelSearchDetails<T> {
|
||||
childrenInRoomString?: string
|
||||
childrenInRoom?: Child[]
|
||||
bookingCode?: string
|
||||
redemption?: boolean
|
||||
}
|
||||
|
||||
export async function getHotelSearchDetails<
|
||||
@@ -105,5 +106,6 @@ export async function getHotelSearchDetails<
|
||||
childrenInRoomString,
|
||||
childrenInRoom,
|
||||
bookingCode: selectHotelParams.bookingCode ?? undefined,
|
||||
redemption: selectHotelParams.searchType === "redemption",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ export async function GET(
|
||||
/** Record<string, any> is next-auth typings */
|
||||
const params: Record<string, any> = {
|
||||
ui_locales: context.params.lang,
|
||||
scope: ["openid", "profile", "booking", "profile_link"],
|
||||
scope: ["openid", "profile", "booking", "profile_link", "availability"],
|
||||
/**
|
||||
* The `acr_values` param is used to make Curity display the proper login
|
||||
* page for Scandic. Without the parameter Curity presents some choices
|
||||
|
||||
@@ -65,7 +65,13 @@ export async function GET(
|
||||
},
|
||||
{
|
||||
ui_locales: context.params.lang,
|
||||
scope: ["openid", "profile"].join(" "),
|
||||
scope: [
|
||||
"openid",
|
||||
"profile",
|
||||
"booking",
|
||||
"availability",
|
||||
"profile_link",
|
||||
].join(" "),
|
||||
loginKey: loginKey,
|
||||
for_origin: publicURL,
|
||||
acr_values: "urn:com:scandichotels:scandic-email",
|
||||
|
||||
Reference in New Issue
Block a user