Disable B codes in booking widget
This commit is contained in:
committed by
Arvid Norlin
parent
74c7c5ccdf
commit
7c6ca562fa
@@ -290,7 +290,22 @@ function BookingCodeError({ codeError }: { codeError: FieldError }) {
|
||||
}
|
||||
className={styles.errorIcon}
|
||||
/>
|
||||
{getErrorMessage(intl, codeError.message)}
|
||||
{codeError.message === bookingWidgetErrors.BOOKING_CODE_ONLY_ENGLISH ? (
|
||||
// eslint-disable-next-line formatjs/no-literal-string-in-jsx
|
||||
<div>
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
Dieser Code ist nur auf unserer{" "}
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
<a href="https://www.scandichotels.com" target="_blank">
|
||||
englischen Website
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
</a>{" "}
|
||||
gültig
|
||||
</div>
|
||||
) : (
|
||||
getErrorMessage(intl, codeError.message)
|
||||
)}
|
||||
</Caption>
|
||||
{isMultiroomErr ? (
|
||||
<RemoveExtraRooms className={styles.hideOnMobile} />
|
||||
|
||||
@@ -9,6 +9,7 @@ export const bookingWidgetErrors = {
|
||||
BED_CHOICE_REQUIRED: "BED_CHOICE_REQUIRED",
|
||||
CHILDREN_EXCEEDS_ADULTS: "CHILDREN_EXCEEDS_ADULTS",
|
||||
BOOKING_CODE_INVALID: "BOOKING_CODE_INVALID",
|
||||
BOOKING_CODE_ONLY_ENGLISH: "BOOKING_CODE_ONLY_ENGLISH",
|
||||
REQUIRED: "REQUIRED",
|
||||
DESTINATION_REQUIRED: "DESTINATION_REQUIRED",
|
||||
MULTIROOM_BOOKING_CODE_UNAVAILABLE: "MULTIROOM_BOOKING_CODE_UNAVAILABLE",
|
||||
@@ -60,6 +61,9 @@ export const bookingCodeSchema = z
|
||||
),
|
||||
{ message: bookingWidgetErrors.BOOKING_CODE_INVALID }
|
||||
)
|
||||
.refine((value) => !value.startsWith("B") && !value.startsWith("b"), {
|
||||
message: bookingWidgetErrors.BOOKING_CODE_ONLY_ENGLISH,
|
||||
})
|
||||
.default(""),
|
||||
remember: z.boolean().default(false),
|
||||
flag: z.boolean().default(false),
|
||||
|
||||
Reference in New Issue
Block a user