From 0402cc720f40c2769cb6714de9a28335d49f35d2 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Mon, 28 Feb 2022 10:25:06 -0500 Subject: [PATCH] naibagte forward --- src/layouts/vehicle-parts/vehicle-parts.vue | 26 ++++++++------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 86936637d..dd591905a 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -33,16 +33,12 @@ import funnelFooter from "@/common-components/funnel-footer/funnel-footer"; import alert from "@/ux-components/alert/alert"; // Supporting Files -import { - fetchCmsContentForPage -} from "@/helpers/cms-content-helper"; -import { - settleAllPromises -} from "@/helpers/layout-helper"; +import {fetchCmsContentForPage} from "@/helpers/cms-content-helper"; +import {settleAllPromises} from "@/helpers/layout-helper"; +import {fmgPageValues} from "@/router/router-constants/fmgPage-values"; +import {storeMutations} from "@/constants/store-mutations"; import store from "@/store"; -import { - fmgPageValues -} from "@/router/router-constants/fmgPage-values"; + export default { name: "vehicle-parts", @@ -154,13 +150,6 @@ export default { }, forwardButtonAction() { - - // Temporary solution to prevent the user from going forward if they have not selected anything. - // will be replaced by validation in the future. - if(Object.keys(this.glassParts).length === 0) { - throw new Error("No parts selected"); - } - const selectedGlassPartNumbers = []; const matchedParts = []; @@ -188,6 +177,11 @@ export default { throw new Error("Could not match any parts to the selected parts"); } + // Save parts to the store. + store.commit(storeMutations.UPDATE_PARTS, matchedParts); + + // Navigate to the next page. + } },