This commit is contained in:
Sneha 2024-03-01 17:13:07 +05:30
parent 43fbdb7c2e
commit b0c931d6fc
2 changed files with 7 additions and 7 deletions

View file

@ -103,7 +103,7 @@
ref="promoModalQuestion"
class="small mt-4"
v-model="lineItems"
@changePromo="handlePromoChange"
emitToGrandparent="true"
:availableVaps="availableVaps"
modalWidgetName="PromoModalWidget" />
</div>
@ -245,10 +245,6 @@ export default {
}
return [];
},
handlePromoChange(lineItems) {
// NOTE: these lineItems are passed from promo-modal-question
this.$emit("update:modelValue", lineItems);
},
},
computed: {
screenReaderTotalAmountDueText() {

View file

@ -106,6 +106,11 @@ export default {
required: false,
default: true,
},
emitToGrandparent: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
promoLinkText() {
@ -175,6 +180,7 @@ export default {
},
onModalClosed() {
this.resetAlerts();
if (this.emitToGrandparent) this.$parent.$emit("update:modelValue", this.lineItems);
this.$emit("update:modelValue", this.lineItems);
this.promoCode = "";
this.modal.resetForm();
@ -213,7 +219,6 @@ export default {
(lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
);
this.$emit("change-promo", this.lineItems);
},
getErrorMessage(error, additionalInfo) {
switch (error) {
@ -305,7 +310,6 @@ export default {
this.lineItems.vaps?.push(...getVaps);
}
this.lineItems?.promos.push(...promoCodeData.promoCode);
this.$emit("change-promo", this.lineItems);
this.closeModal();
} else {
this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo);