Merged in feat/SW-3477-hide-voucher-booking-code-sas- (pull request #2836)
feat(SW-3477) Updated booking widget for SAS white label Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ScandicPartnersEnum } from "@scandic-hotels/common/constants/scandicPartners"
|
||||
import { logger } from "@scandic-hotels/common/logger"
|
||||
import { phoneErrors } from "@scandic-hotels/common/utils/zod/phoneValidator"
|
||||
|
||||
@@ -9,7 +10,11 @@ import {
|
||||
|
||||
import type { IntlShape } from "react-intl"
|
||||
|
||||
export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
||||
export function getErrorMessage(
|
||||
intl: IntlShape,
|
||||
errorCode?: string,
|
||||
partner?: ScandicPartnersEnum
|
||||
) {
|
||||
switch (errorCode) {
|
||||
case bookingWidgetErrors.BOOKING_CODE_INVALID:
|
||||
return intl.formatMessage({
|
||||
@@ -42,10 +47,15 @@ export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
||||
"Multi-room booking is not available with this booking code.",
|
||||
})
|
||||
case bookingWidgetErrors.MULTIROOM_REWARD_NIGHT_UNAVAILABLE:
|
||||
return intl.formatMessage({
|
||||
defaultMessage:
|
||||
"Multi-room booking is not available with reward night.",
|
||||
})
|
||||
return partner === ScandicPartnersEnum.sas
|
||||
? intl.formatMessage({
|
||||
defaultMessage:
|
||||
"Multi-room booking is not available with euro bonus points.",
|
||||
})
|
||||
: intl.formatMessage({
|
||||
defaultMessage:
|
||||
"Multi-room booking is not available with reward night.",
|
||||
})
|
||||
case bookingWidgetErrors.CODE_VOUCHER_REWARD_NIGHT_UNAVAILABLE:
|
||||
return intl.formatMessage({
|
||||
defaultMessage:
|
||||
|
||||
Reference in New Issue
Block a user