fix: we shouldn't check if is regular rate on public rate since its not guaranteed to exist
This commit is contained in:
committed by
Michael Zetterberg
parent
0758a4686c
commit
9322a7385a
@@ -15,7 +15,6 @@ import {
|
||||
import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel"
|
||||
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
|
||||
import { BookingCodeFilterEnum } from "@/types/enums/bookingCodeFilter"
|
||||
import { RateTypeEnum } from "@/types/enums/rateType"
|
||||
import type { Package, Packages } from "@/types/requests/packages"
|
||||
import type { InitialState, RatesState } from "@/types/stores/rates"
|
||||
import type { PriceProduct } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
@@ -348,14 +347,10 @@ export function createRatesStore({
|
||||
productRateCode = selectedRate.product.voucher.rateCode
|
||||
}
|
||||
|
||||
let isRegularRate = false
|
||||
if (
|
||||
"public" in selectedRate.product &&
|
||||
selectedRate.product.public
|
||||
) {
|
||||
isRegularRate =
|
||||
selectedRate.product.public.rateType ===
|
||||
RateTypeEnum.Regular
|
||||
productRateCode = selectedRate.product.public.rateCode
|
||||
}
|
||||
|
||||
@@ -370,10 +365,7 @@ export function createRatesStore({
|
||||
}
|
||||
|
||||
const isMemberRate =
|
||||
isUserLoggedIn &&
|
||||
isMainRoom &&
|
||||
hasMemberRate &&
|
||||
isRegularRate
|
||||
isUserLoggedIn && isMainRoom && hasMemberRate
|
||||
|
||||
state.rooms[idx].bookingRoom.rateCode = isMemberRate
|
||||
? memberRateCode
|
||||
|
||||
Reference in New Issue
Block a user