From a21c5c61c1a0182cfad12f985c23509484fdd913 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 29 Oct 2021 16:40:18 -0400 Subject: [PATCH] edits --- .../carAttributes/carAttributes.vue | 6 +++--- src/layouts/selectYear/selectYear.vue | 2 +- src/router/index.js | 12 ++++++++++++ src/store/index.js | 13 ++----------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/commonComponents/carAttributes/carAttributes.vue b/src/commonComponents/carAttributes/carAttributes.vue index 0297654ee..1bb084cb4 100644 --- a/src/commonComponents/carAttributes/carAttributes.vue +++ b/src/commonComponents/carAttributes/carAttributes.vue @@ -2,14 +2,14 @@
- +
diff --git a/src/layouts/selectYear/selectYear.vue b/src/layouts/selectYear/selectYear.vue index 4f0a2a018..f7d49cf58 100644 --- a/src/layouts/selectYear/selectYear.vue +++ b/src/layouts/selectYear/selectYear.vue @@ -22,7 +22,7 @@ export default { }; }, mounted() { - axios.get("https://mockey.qa.sagaws.net/service/years").then((response) => { + axios.get("https://consumerapidev.safelite.com/vehicle/api/v1/vehicle/years").then((response) => { this.years = response.data.Result; }); }, diff --git a/src/router/index.js b/src/router/index.js index c0e4b170d..e7dafb885 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,8 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js" import NotFound from "@/layouts/notFound/notFound.vue"; import Home from "@/layouts/home/home.vue"; import store from "@/store"; +import selectYear from "@/layouts/selectYear/selectYear.vue" +import selectMake from "@/layouts/selectMake/selectMake.vue" const routes = [ { @@ -16,6 +18,16 @@ const routes = [ Name: "Home", component: Home, }, + { + path: "/select-year", + name: "selectYear", + component: selectYear, + }, + { + path: "/select-make", + name: "selectMake", + component: selectMake, + }, ]; const router = createRouter({ diff --git a/src/store/index.js b/src/store/index.js index aa638fb86..6c35ceffb 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -27,7 +27,7 @@ export default createStore({ mutations: { updateYear(state, data) { state.year = data.year; - state.makes = data.makes; + state.makes = data.makes.data.Result; state.slideTransition = "slide"; }, updateMake(state, data) { @@ -56,16 +56,7 @@ export default createStore({ }, actions: { async selectYear(context, year) { - let makes = []; - await globalMethods - .callHttpClient({ - method: "GET", - endpoint: `https://mockey.qa.sagaws.net/service/makes/year=${year}`, - payload: {}, - }) - .then(function (response) { - makes = response.data.Result; - }); + const makes = await axios.get(`https://mockey.qa.sagaws.net/service/makes/year=${year}`); context.commit("updateYear", { year, makes }); router.push(`/select-make?year=${year}`); },