From 3d44e5522c4a51a86b18f8e003e1ca391ef722f0 Mon Sep 17 00:00:00 2001 From: AdamCaouetteSafelite Date: Wed, 17 Sep 2025 15:02:41 -0400 Subject: [PATCH] CASH-1499: additional piece to update inactive promos --- src/fmg-components/cart/cart.vue | 12 ++++++++++++ src/layouts/payment-method/payment-method.vue | 1 + 2 files changed, 13 insertions(+) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index c1f281e3d..5a611390d 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -195,6 +195,7 @@ export default { name: "cart", props: { modelValue: Object, + inactivePromos: Object, damage: Object, servicePackageOptionsCmsName: String, availableVaps: Object, @@ -327,15 +328,26 @@ export default { this.lineItems.vaps = [...lineItems.vaps]; this.lineItems.promos = [...lineItems.promos]; await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); + + // any new promos that are also in inactive list? + const newInactivePromos = this.inactivePromos.filter((promo) => { + return this.lineItems.promos.includes(promo); + }); + this.updateInactivePromos(newInactivePromos); + await this.dispatchStoreAction( storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS, { activePromos: this.lineItems.promos, + inactivePromos: this.inactivePromos, }, false ); }, + updateInactivePromos(newInactivePromos) { + this.$emit("update:inactivePromos", newInactivePromos); + }, getPromoCodeList() { if (this.$refs["promoModalQuestion"]) { return this.$refs["promoModalQuestion"].getPromoCodeList(); diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 323070d39..db5ccdced 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -22,6 +22,7 @@ :availableVaps="availableVaps" :allowItemRemoval="true" v-model="lineItems" + v-model:inactivePromos="inactivePromos" pageName="payment-method" servicePackageOptionsCmsName="ServicePackageTitle" recyclingModalCmsWidgetName="RecycleModal"