From bc3468f8d62ca2f277b8a7d9255e8d29494da2b7 Mon Sep 17 00:00:00 2001 From: Sneha Date: Wed, 15 Nov 2023 18:14:52 +0530 Subject: [PATCH] Format --- .../promo-modal-question/promo-modal-question.vue | 6 ++---- .../promo-modal-question/promo-question/promo-question.vue | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue index ac42fce2e..deff594e5 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue @@ -217,13 +217,11 @@ export default { } else { if (promoCodeData.errorCode == promoErrorCodes.PROMO_STACKING_NOT_ALLOWED) { this.displayInvalidOnOrderPromoAlert = true; - this.focusOnPromoInput(); - this.resetModalButtonStyle(); } else { this.displayInvalidPromoAlert = true; - this.focusOnPromoInput(); - this.resetModalButtonStyle(); } + this.focusOnPromoInput(); + this.resetModalButtonStyle(); } } }, diff --git a/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue b/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue index 7b4fd9049..053e8eedc 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue @@ -23,6 +23,8 @@ import { errorMessages } from "@/constants/error-messages"; // Define Validation Rules defineRule("promo-required", required(errorMessages.PROMO_REQUIRED)); +const ALPHANUMERIC_REGEX = /[^a-zA-Z0-9]/g; + export default { name: "promo-question", props: { @@ -41,7 +43,7 @@ export default { }, methods: { validateAlphanumeric() { - this.value = this.value.replace(/[^a-zA-Z0-9]/g, ""); + this.value = this.value.replace(ALPHANUMERIC_REGEX, ""); }, }, components: {