Fixed logic that was pulling back available wipers incorrectly
This commit is contained in:
parent
dc91998d6a
commit
5604ffd1a8
1 changed files with 5 additions and 2 deletions
|
|
@ -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 ?? [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue