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 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
|
||||
? baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_WIPERS,
|
||||
{
|
||||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
carId: store.getters.vehicle.carId,
|
||||
},
|
||||
"payment-method"
|
||||
)
|
||||
: Promise.resolve([]);
|
||||
const wipersPromise =
|
||||
!orderHasFrontWipers || !orderHasRearWipers
|
||||
? baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_WIPERS,
|
||||
{
|
||||
serviceZipCode: store.getters.order.serviceLocation.zipCode,
|
||||
carId: store.getters.vehicle.carId,
|
||||
},
|
||||
"payment-method"
|
||||
)
|
||||
: Promise.resolve([]);
|
||||
|
||||
const rainDefensePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_RAIN_DEFENSE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue