Update promo-modal-question.vue

This commit is contained in:
Sneha 2023-11-24 14:44:01 +05:30
parent 1945bb02d9
commit 860eed4151

View file

@ -209,21 +209,17 @@ export default {
switch (error) {
case promoErrorCodes.PROMO_STACKING_NOT_ALLOWED:
case promoErrorCodes.SIMILAR_PROMO_ALREADY_ON_ORDER:
if (
additionalInfo.length === 1 &&
return additionalInfo.length === 1 &&
additionalInfo[0] === this.promoCode.toUpperCase()
) {
return (this.displaySimilarPromoAlert = true);
} else {
this.errorMessage = this.StackPromoText?.replaceAll(
"{custom:NEWPROMOCODE}",
this.promoCode.toUpperCase()
).replaceAll(
"{custom:OLDPROMOCODE}",
this.getConflictingPromoCode(additionalInfo)
);
return (this.displayStackingPromoAlert = true);
}
? (this.displaySimilarPromoAlert = true)
: ((this.errorMessage = this.StackPromoText?.replace(
/\{custom:(NEW|OLD)PROMOCODE\}/g,
(match, group) =>
group === "NEW"
? this.promoCode.toUpperCase()
: this.getConflictingPromoCode(additionalInfo)
)),
(this.displayStackingPromoAlert = true));
case promoErrorCodes.INVALID_PROMO_ON_ORDER:
if (additionalInfo.some((x) => x.toUpperCase() === "APPOINTMENT_TYPE")) {
this.errorMessage = this.InShopPromoText?.replaceAll(