CSR-2323 save promos to cart as soon as entered
CSR-2323 save promos to cart as soon as entered
This commit is contained in:
parent
bb221a1958
commit
e66f2f9ea6
2 changed files with 11 additions and 3 deletions
|
|
@ -291,9 +291,17 @@ export default {
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
async saveVaps(vaps) {
|
async saveVaps(lineItems) {
|
||||||
this.lineItems.vaps = [...vaps];
|
this.lineItems.vaps = [...lineItems.vaps];
|
||||||
|
this.lineItems.promos = [...lineItems.promos];
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
|
||||||
|
await this.dispatchStoreAction(
|
||||||
|
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
|
||||||
|
{
|
||||||
|
activePromos: this.lineItems.promos,
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPromoCodeList() {
|
getPromoCodeList() {
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.lineItems?.promos.push(...promoCodeData.promoCode);
|
this.lineItems?.promos.push(...promoCodeData.promoCode);
|
||||||
|
|
||||||
this.$emit('promoAdded', this.lineItems.vaps);
|
this.$emit("promoAdded", this.lineItems);
|
||||||
|
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue