fix: public promotion with code did not make it through the check sometimes
This commit is contained in:
@@ -167,7 +167,7 @@ export default function SelectHotelContent({
|
||||
>
|
||||
<Link href={selectHotel(lang)} keepSearchParams>
|
||||
<MaterialIcon icon="arrow_back" color="CurrentColor" size={20} />
|
||||
{intl.formatMessage({ id: "Back" })}
|
||||
{intl.formatMessage({ defaultMessage: "Back" })}
|
||||
</Link>
|
||||
</Button>
|
||||
<FilterAndSortModal
|
||||
|
||||
@@ -26,17 +26,13 @@ export default function Campaign({
|
||||
roomTypeCode,
|
||||
}: CampaignProps) {
|
||||
const intl = useIntl()
|
||||
const { roomAvailability, roomNr, selectedFilter, selectedRate } =
|
||||
useRoomContext()
|
||||
const { roomNr, selectedFilter, selectedRate } = useRoomContext()
|
||||
const rateTitles = useRateTitles()
|
||||
|
||||
let isCampaignRate = false
|
||||
if (roomAvailability && "rateDefinitions" in roomAvailability) {
|
||||
if (roomAvailability.rateDefinitions.length === 1) {
|
||||
const rateDefinition = roomAvailability.rateDefinitions[0]
|
||||
isCampaignRate = rateDefinition.isCampaignRate
|
||||
}
|
||||
}
|
||||
const isCampaignRate = campaign.some(
|
||||
(c) =>
|
||||
c.rateDefinition.isCampaignRate || c.rateDefinitionMember?.isCampaignRate
|
||||
)
|
||||
|
||||
if (selectedFilter === BookingCodeFilterEnum.Discounted && !isCampaignRate) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user