From e66f2f9ea66879aea5a401f69aa27634c58aa035 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 6 Nov 2024 10:45:56 -0500 Subject: [PATCH] CSR-2323 save promos to cart as soon as entered CSR-2323 save promos to cart as soon as entered --- src/fmg-components/cart/cart.vue | 12 ++++++++++-- .../promo-modal-question/promo-modal-question.vue | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 0a3b3576a..0e3093007 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -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() { diff --git a/src/fmg-components/promo-modal-question/promo-modal-question.vue b/src/fmg-components/promo-modal-question/promo-modal-question.vue index 4a32b03fc..a6b591e67 100644 --- a/src/fmg-components/promo-modal-question/promo-modal-question.vue +++ b/src/fmg-components/promo-modal-question/promo-modal-question.vue @@ -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 {