Merge pull request #1665 from Safelite/feature/CSR-1851-fix-missing-add-wipers-button
Fixed logic that was pulling back available wipers incorrectly
This commit is contained in:
commit
90d1d0cdd8
1 changed files with 14 additions and 10 deletions
|
|
@ -129,27 +129,31 @@ export default {
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
|
|
||||||
const lineItemsFromStore = deepClone(store.getters.order.lineItems);
|
const lineItemsFromStore = deepClone(store.getters.order.lineItems);
|
||||||
|
|
||||||
const frontWipersOnOrder =
|
const frontWipersOnOrder =
|
||||||
lineItemsFromStore.vaps.filter(
|
lineItemsFromStore.vaps.filter(
|
||||||
(wiper) => wiper.partType == partTypeStrings.FRONT_WIPER
|
(wiper) => wiper.partType == partTypeStrings.FRONT_WIPER
|
||||||
) ?? [];
|
) ?? [];
|
||||||
|
|
||||||
const rearWipersOnOrder =
|
const rearWipersOnOrder =
|
||||||
lineItemsFromStore.vaps.filter(
|
lineItemsFromStore.vaps.filter(
|
||||||
(wiper) => wiper.partType == partTypeStrings.REAR_WIPER
|
(wiper) => wiper.partType == partTypeStrings.REAR_WIPER
|
||||||
) ?? [];
|
) ?? [];
|
||||||
|
|
||||||
const orderHasFrontWipers = frontWipersOnOrder.length > 0;
|
const orderHasFrontWipers = frontWipersOnOrder.length > 0;
|
||||||
const orderHasRearWipers = rearWipersOnOrder.length > 0;
|
const orderHasRearWipers = rearWipersOnOrder.length > 0;
|
||||||
|
|
||||||
const wipersPromise = orderHasFrontWipers
|
const wipersPromise =
|
||||||
? baseMixin.methods.dispatchStoreActionWithLogging(
|
!orderHasFrontWipers || !orderHasRearWipers
|
||||||
storeActions.GET_WIPERS,
|
? baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
{
|
storeActions.GET_WIPERS,
|
||||||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
{
|
||||||
carId: store.getters.vehicle.carId,
|
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||||
},
|
carId: store.getters.vehicle.carId,
|
||||||
"payment-method"
|
},
|
||||||
)
|
"payment-method"
|
||||||
: Promise.resolve([]);
|
)
|
||||||
|
: Promise.resolve([]);
|
||||||
|
|
||||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_RAIN_DEFENSE,
|
storeActions.GET_RAIN_DEFENSE,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue