diff --git a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx index 05c44da3d..dfdc6957d 100644 --- a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx +++ b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx @@ -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 +
+ {/* 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 */} + + englischen Website + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} + {" "} + gültig +
+ ) : ( + getErrorMessage(intl, codeError.message) + )} {isMultiroomErr ? ( diff --git a/apps/scandic-web/components/Forms/BookingWidget/schema.ts b/apps/scandic-web/components/Forms/BookingWidget/schema.ts index 4d3d71468..d31e7782f 100644 --- a/apps/scandic-web/components/Forms/BookingWidget/schema.ts +++ b/apps/scandic-web/components/Forms/BookingWidget/schema.ts @@ -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),