Fixed logic that was pulling back available wipers incorrectly

This commit is contained in:
Leah Schumann 2023-12-28 09:52:23 -05:00
parent dc91998d6a
commit 5604ffd1a8

View file

@ -124,18 +124,21 @@ export default {
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
const lineItemsFromStore = deepClone(store.getters.order.lineItems);
const frontWipersOnOrder =
lineItemsFromStore.vaps.filter(
(wiper) => wiper.partType == partTypeStrings.FRONT_WIPER
) ?? [];
const rearWipersOnOrder =
lineItemsFromStore.vaps.filter(
(wiper) => wiper.partType == partTypeStrings.REAR_WIPER
) ?? [];
const orderHasFrontWipers = frontWipersOnOrder.length > 0;
const orderHasRearWipers = rearWipersOnOrder.length > 0;
const wipersPromise = orderHasFrontWipers
const wipersPromise = (!orderHasFrontWipers || !orderHasRearWipers)
? baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.GET_WIPERS,
{
@ -168,7 +171,7 @@ export default {
];
const resultMap = await settleAllPromises(promiseResultMap);
console.log(resultMap.wipers)
const glassParts = lineItemsFromStore.glassParts ?? [];
const supportingItems = lineItemsFromStore.supportingItems ?? [];
const vaps = lineItemsFromStore.vaps ?? [];