fix: make sure all searchparams are used in redirect

This commit is contained in:
Simon Emanuelsson
2024-11-19 11:24:17 +01:00
committed by Simon.Emanuelsson
parent 1b3999a050
commit 744af22b08
9 changed files with 65 additions and 49 deletions

View File

@@ -31,7 +31,10 @@ export function filterDuplicateRoomTypesByLowestPrice(
products.forEach((product) => {
const { productType } = product
const publicProduct = productType.public
const publicProduct = productType.public || {
requestedPrice: null,
localPrice: null,
}
const memberProduct = productType.member || {
requestedPrice: null,
localPrice: null,
@@ -53,7 +56,7 @@ export function filterDuplicateRoomTypesByLowestPrice(
Number(memberRequestedPrice?.pricePerNight) ?? Infinity
)
const currentLocalPrice = Math.min(
Number(publicLocalPrice.pricePerNight) ?? Infinity,
Number(publicLocalPrice?.pricePerNight) ?? Infinity,
Number(memberLocalPrice?.pricePerNight) ?? Infinity
)