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