feat: SW-1588 Implemented booking code select-rate
This commit is contained in:
@@ -24,6 +24,8 @@ import {
|
||||
HotelCardListingTypeEnum,
|
||||
} from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps"
|
||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
||||
import { BookingCodeFilterEnum } from "@/types/enums/bookingCodeFilter"
|
||||
import { RateTypeEnum } from "@/types/enums/rateType"
|
||||
|
||||
export default function HotelCardListing({
|
||||
hotelData,
|
||||
@@ -55,10 +57,11 @@ export default function HotelCardListing({
|
||||
? sortedHotels.filter(
|
||||
(hotel) =>
|
||||
!hotel.price ||
|
||||
activeCodeFilter === "all" ||
|
||||
(activeCodeFilter === "discounted" &&
|
||||
hotel.price?.public?.rateType?.toLowerCase() !== "regular") ||
|
||||
activeCodeFilter === hotel.price?.public?.rateType?.toLowerCase()
|
||||
activeCodeFilter === BookingCodeFilterEnum.All ||
|
||||
(activeCodeFilter === BookingCodeFilterEnum.Discounted &&
|
||||
hotel.price?.public?.rateType !== RateTypeEnum.Regular) ||
|
||||
(activeCodeFilter === BookingCodeFilterEnum.Regular &&
|
||||
hotel.price?.public?.rateType === RateTypeEnum.Regular)
|
||||
)
|
||||
: sortedHotels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user