CSR-1971 | Continue to clean up code

This commit is contained in:
Scott Kiener 2024-03-01 15:21:38 -05:00
parent e67b661279
commit b42e436288
3 changed files with 4 additions and 22 deletions

View file

@ -236,6 +236,8 @@ export default {
this.lineItems[category] = this.lineItems[category].filter(
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
);
this.$emit("update:modelValue", this.lineItems);
},
getPromoCodeList() {
if (this.$refs["promoModalQuestion"]) {
@ -243,10 +245,6 @@ export default {
}
return [];
},
handleAddedPromo(lineItems) {
// NOTE: these lineItems are passed from promo-modal-question
//this.$emit("update:modelValue", lineItems);
},
},
computed: {
screenReaderTotalAmountDueText() {
@ -847,12 +845,6 @@ export default {
this.lineItems = deepClone(newValue);
},
deep: true,
},
lineItems: {
handler(newValue) {
console.log('cart emitted a modelValue update');
this.$emit("update:modelValue", newValue);
}
}
},
components: {

View file

@ -149,10 +149,6 @@ export default {
},
];
// -Check PRs to make sure you've looked at all newly added code
// -Briefly investigate new issue, then ask Sneha to look at it via email
// -Undo the package selection fix sneha did and see if my changes fix that
const resultMap = await settleAllPromises(promiseResultMap);
const lineItems = deepClone(store.getters.order.lineItems);
lineItems.promos = lineItems.promos ?? [];
@ -180,23 +176,20 @@ export default {
false
);
lineItems.supportingItems = resultMap.supportingItems;
const addableVaps = [...resultMap.wipers, resultMap.rainDefense];
// Promo logic
// Populate the previous state of promos for toast message usage in "next()"
const addableVaps = [...resultMap.wipers, resultMap.rainDefense];
const oldActivePromos = store.getters.lineItems.promos?.slice(0);
const oldInactivePromos = store.getters.order.payment.inactivePromos?.slice(0);
const promoCodeFromQueryString = getQuerystringParameter(queryStrings.PROMO);
console.log("lineItems before sending off for promo");
console.log(JSON.parse(JSON.stringify(lineItems)));
const { validatePromoResponse, revalidatePromoResponse } =
await revalidatePromosAndValidateQueryStringPromo(
promoCodeFromQueryString,
pricingResults,
"quote"
);
console.log("lineItems.vaps", JSON.parse(JSON.stringify(lineItems.vaps)));
// End of promo logic
// Call the "next" function to complete the transition to this page.
@ -326,8 +319,7 @@ export default {
this.dispatchStoreAction(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{
activePromos: this.lineItems.promos,
inactivePromos: this.$store.getters.order.payment.inactivePromos, // I don't think we need this here
activePromos: this.lineItems.promos
},
false
);

View file

@ -2176,7 +2176,6 @@ export const actions = {
context.commit(storeMutations.UPDATE_SUPPORTING_ITEMS, supportingItems);
},
saveVaps(context, vaps) {
console.log("saving vaps");
addGuidToLineItemsIfNotAlreadyThere(vaps);
context.commit(storeMutations.UPDATE_VAPS, vaps);
},
@ -2427,7 +2426,6 @@ export const actions = {
lineItemsToUse = lineItemsToUse ? deepClone(lineItemsToUse) : deepClone(order.lineItems);
addGuidToLineItemsIfNotAlreadyThere(lineItemsToUse.vaps);
lineItemsToUse.promos = activePromosToUse;
console.log("lineItemsToUse:", lineItemsToUse);
inactivePromosToUse = inactivePromosToUse ?? order.payment.inactivePromos;
inactivePromosToUse = removeCurrentlyActivePromoCodesFromInactivePromos(