CSR-110: refactoring per PR review

This commit is contained in:
Adam Caouette 2022-07-26 10:38:10 -04:00
parent 7badd9f18e
commit e31f415aa4

View file

@ -141,11 +141,9 @@ export default {
// call API parts method
const partsLookup = await this.dispatchStoreAction(storeActions.GET_PARTS)
.catch(() => {
this.$refs.funnelFooter.removeLoader();
return this.$refs.funnelFooter.removeLoader();
});
if (!partsLookup) { return }
const glassNameAndPartsForStore = partsLookup.data.glassNameAndPartsForStore;
console.log("glassNameAndPartsForStore: ", glassNameAndPartsForStore);
@ -236,11 +234,11 @@ export default {
}
});
if (!hasMultipleParts) {
store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts);
this.$store.commit(storeMutations.UPDATE_GLASS_PARTS, collectedGlassParts);
}
this.navigateForward(hasMultipleParts, glassNameAndPartsForStore);
},
async navigateForward(hasMultipleParts, glassNameAndPartsForStore) {
navigateForward(hasMultipleParts, glassNameAndPartsForStore) {
if (hasMultipleParts) {
// if multiple parts on any glass
// go to vehicle-parts page and pass the partsData