Merge pull request #2851 from Safelite/feature/bugfix/CASH-1499-test

Feature/bugfix/cash-1499
This commit is contained in:
AdamCaouetteSafelite 2025-09-17 16:38:22 -04:00 committed by GitHub
commit f987d7e522
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -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();

View file

@ -22,6 +22,7 @@
:availableVaps="availableVaps"
:allowItemRemoval="true"
v-model="lineItems"
v-model:inactivePromos="inactivePromos"
pageName="payment-method"
servicePackageOptionsCmsName="ServicePackageTitle"
recyclingModalCmsWidgetName="RecycleModal"