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:
CarlNation 2024-11-06 10:45:56 -05:00
parent bb221a1958
commit e66f2f9ea6
2 changed files with 11 additions and 3 deletions

View file

@ -291,9 +291,17 @@ export default {
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
},
async saveVaps(vaps) {
this.lineItems.vaps = [...vaps];
async saveVaps(lineItems) {
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_ACTIVE_AND_OR_INACTIVE_PROMOS,
{
activePromos: this.lineItems.promos,
},
false
);
},
getPromoCodeList() {

View file

@ -321,7 +321,7 @@ export default {
}
this.lineItems?.promos.push(...promoCodeData.promoCode);
this.$emit('promoAdded', this.lineItems.vaps);
this.$emit("promoAdded", this.lineItems);
this.closeModal();
} else {