commit
ad72b37943
2 changed files with 7 additions and 6 deletions
|
|
@ -103,7 +103,7 @@
|
||||||
ref="promoModalQuestion"
|
ref="promoModalQuestion"
|
||||||
class="small mt-4"
|
class="small mt-4"
|
||||||
v-model="lineItems"
|
v-model="lineItems"
|
||||||
@addedPromo="handleAddedPromo"
|
emitToGrandparent="true"
|
||||||
:availableVaps="availableVaps"
|
:availableVaps="availableVaps"
|
||||||
modalWidgetName="PromoModalWidget" />
|
modalWidgetName="PromoModalWidget" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -245,10 +245,6 @@ export default {
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
handleAddedPromo(lineItems) {
|
|
||||||
// NOTE: these lineItems are passed from promo-modal-question
|
|
||||||
this.$emit("update:modelValue", lineItems);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
screenReaderTotalAmountDueText() {
|
screenReaderTotalAmountDueText() {
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,11 @@ export default {
|
||||||
required: false,
|
required: false,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
emitToGrandparent: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
promoLinkText() {
|
promoLinkText() {
|
||||||
|
|
@ -175,6 +180,7 @@ export default {
|
||||||
},
|
},
|
||||||
onModalClosed() {
|
onModalClosed() {
|
||||||
this.resetAlerts();
|
this.resetAlerts();
|
||||||
|
if (this.emitToGrandparent) this.$parent.$emit("update:modelValue", this.lineItems);
|
||||||
this.$emit("update:modelValue", this.lineItems);
|
this.$emit("update:modelValue", this.lineItems);
|
||||||
this.promoCode = "";
|
this.promoCode = "";
|
||||||
this.modal.resetForm();
|
this.modal.resetForm();
|
||||||
|
|
@ -304,7 +310,6 @@ export default {
|
||||||
this.lineItems.vaps?.push(...getVaps);
|
this.lineItems.vaps?.push(...getVaps);
|
||||||
}
|
}
|
||||||
this.lineItems?.promos.push(...promoCodeData.promoCode);
|
this.lineItems?.promos.push(...promoCodeData.promoCode);
|
||||||
this.$emit("added-promo", this.lineItems);
|
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
} else {
|
} else {
|
||||||
this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo);
|
this.getErrorMessage(promoCodeData.errorCode, promoCodeData.additionalInfo);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue