feat(SW-1717): rewrite select-rate to show all variants of rate-cards
This commit is contained in:
committed by
Michael Zetterberg
parent
adde77eaa9
commit
ebaea78fb3
@@ -106,11 +106,25 @@ export default function useModifyStay({
|
||||
return { success: false, noAvailability: true }
|
||||
}
|
||||
|
||||
const roomPrice = isLoggedIn
|
||||
? data.memberRate?.localPrice.pricePerStay
|
||||
: data.publicRate?.localPrice.pricePerStay
|
||||
let roomPrice = 0
|
||||
if (isLoggedIn && "member" in data.product && data.product.member) {
|
||||
roomPrice = data.product.member.localPrice.pricePerStay
|
||||
} else if ("public" in data.product && data.product.public) {
|
||||
roomPrice = data.product.public.localPrice.pricePerStay
|
||||
} else if (
|
||||
"corporateCheque" in data.product &&
|
||||
data.product.corporateCheque.localPrice.additionalPricePerStay
|
||||
) {
|
||||
roomPrice =
|
||||
data.product.corporateCheque.localPrice.additionalPricePerStay
|
||||
} else if (
|
||||
"redemption" in data.product &&
|
||||
data.product.redemption.localPrice.additionalPricePerStay
|
||||
) {
|
||||
roomPrice = data.product.redemption.localPrice.additionalPricePerStay
|
||||
}
|
||||
|
||||
totalNewPrice += roomPrice ?? 0
|
||||
totalNewPrice += roomPrice
|
||||
availabilityResults.push(data)
|
||||
} catch (error) {
|
||||
console.error("Error checking room availability:", error)
|
||||
|
||||
Reference in New Issue
Block a user