This commit is contained in:
Sneha 2023-11-15 18:14:52 +05:30
parent 61aeb06e0a
commit bc3468f8d6
2 changed files with 5 additions and 5 deletions

View file

@ -217,13 +217,11 @@ export default {
} else { } else {
if (promoCodeData.errorCode == promoErrorCodes.PROMO_STACKING_NOT_ALLOWED) { if (promoCodeData.errorCode == promoErrorCodes.PROMO_STACKING_NOT_ALLOWED) {
this.displayInvalidOnOrderPromoAlert = true; this.displayInvalidOnOrderPromoAlert = true;
this.focusOnPromoInput();
this.resetModalButtonStyle();
} else { } else {
this.displayInvalidPromoAlert = true; this.displayInvalidPromoAlert = true;
this.focusOnPromoInput();
this.resetModalButtonStyle();
} }
this.focusOnPromoInput();
this.resetModalButtonStyle();
} }
} }
}, },

View file

@ -23,6 +23,8 @@ import { errorMessages } from "@/constants/error-messages";
// Define Validation Rules // Define Validation Rules
defineRule("promo-required", required(errorMessages.PROMO_REQUIRED)); defineRule("promo-required", required(errorMessages.PROMO_REQUIRED));
const ALPHANUMERIC_REGEX = /[^a-zA-Z0-9]/g;
export default { export default {
name: "promo-question", name: "promo-question",
props: { props: {
@ -41,7 +43,7 @@ export default {
}, },
methods: { methods: {
validateAlphanumeric() { validateAlphanumeric() {
this.value = this.value.replace(/[^a-zA-Z0-9]/g, ""); this.value = this.value.replace(ALPHANUMERIC_REGEX, "");
}, },
}, },
components: { components: {