Prettified
This commit is contained in:
parent
2ea2176865
commit
669ea2927c
2 changed files with 11 additions and 6 deletions
|
|
@ -134,7 +134,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
|
||||||
pageNameToLog,
|
pageNameToLog,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (validatePromoResponse.errorCode == null) {
|
if (validatePromoResponse.errorCode == null) {
|
||||||
// Save promo to store
|
// Save promo to store
|
||||||
const activePromos = store.getters.order.lineItems.promos ?? [];
|
const activePromos = store.getters.order.lineItems.promos ?? [];
|
||||||
|
|
|
||||||
|
|
@ -382,17 +382,22 @@ export default {
|
||||||
// Because we don't yet have a robust solution for part interchange ...
|
// Because we don't yet have a robust solution for part interchange ...
|
||||||
// if there are front wiper line items in the revalidate response, we need to delete any existing front wiper line items from the store
|
// if there are front wiper line items in the revalidate response, we need to delete any existing front wiper line items from the store
|
||||||
// and replace them with those that come back from revalidation.
|
// and replace them with those that come back from revalidation.
|
||||||
const revalidateResponseHasFrontWiperLineItems =
|
const revalidateResponseHasFrontWiperLineItems =
|
||||||
revalidatePromoResponse.promoLineItems.find(
|
revalidatePromoResponse.promoLineItems.find(
|
||||||
lineItem => lineItem.partType == partTypeStrings.FRONT_WIPER).length > 0;
|
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
|
||||||
|
).length > 0;
|
||||||
|
|
||||||
if (revalidateResponseHasFrontWiperLineItems) {
|
if (revalidateResponseHasFrontWiperLineItems) {
|
||||||
const frontWiperLineItemsInStore = this.lineItems.vaps.find(lineItem => lineItem.partType == partTypeStrings.FRONT_WIPER);
|
const frontWiperLineItemsInStore = this.lineItems.vaps.find(
|
||||||
|
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
|
||||||
|
);
|
||||||
if (frontWiperLineItemsInStore.length > 0) {
|
if (frontWiperLineItemsInStore.length > 0) {
|
||||||
this.lineItems.vaps = this.lineItems.vaps.find(lineItem => lineItem.partType != partTypeStrings.FRONT_WIPER);
|
this.lineItems.vaps = this.lineItems.vaps.find(
|
||||||
|
(lineItem) => lineItem.partType != partTypeStrings.FRONT_WIPER
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
|
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
|
||||||
revalidatePromoResponse.promoLineItems,
|
revalidatePromoResponse.promoLineItems,
|
||||||
this.availableVaps,
|
this.availableVaps,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue