From f74ee61231531d536367a3dbda91888d54e8d352 Mon Sep 17 00:00:00 2001 From: Kulbhushan Kaushik Date: Tue, 1 Nov 2022 15:09:43 -0400 Subject: [PATCH] commit --- src/constants/endpoints.js | 4 + .../model-question/model-question.vue | 10 +- src/layouts/vehicle-model/vehicle-model.vue | 97 +++++++++++++++++++ src/router/router-constants/issPage-values.js | 1 + .../router-constants/navigation-scenarios.js | 2 + src/router/router-constants/routing-table.js | 15 ++- src/store/index.js | 15 +++ 7 files changed, 135 insertions(+), 9 deletions(-) diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 89e1f1fc..642fc752 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -19,6 +19,10 @@ const endpoints = { url: "/vehicle/api/v1/vehicle/makes/", method: "GET", }, + GetVehicleModels: { + url: "/vehicle/api/v1/vehicle/Models", + method: "GET", + } }; export { endpoints }; diff --git a/src/layouts/vehicle-model/model-question/model-question.vue b/src/layouts/vehicle-model/model-question/model-question.vue index 5259e0fd..064007e0 100644 --- a/src/layouts/vehicle-model/model-question/model-question.vue +++ b/src/layouts/vehicle-model/model-question/model-question.vue @@ -14,10 +14,7 @@ + \ No newline at end of file diff --git a/src/router/router-constants/issPage-values.js b/src/router/router-constants/issPage-values.js index 8bdc935c..1fe10c52 100644 --- a/src/router/router-constants/issPage-values.js +++ b/src/router/router-constants/issPage-values.js @@ -3,5 +3,6 @@ export const issPageValues = { WELCOME_PAGE: "welcome-page", VEHICLE_MAKE: "vehicle-make", VEHICLE_YEAR: "vehicle-year", + VEHICLE_MODEL: "vehicle-model" }; \ No newline at end of file diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index bcfd87d4..01a1d7a8 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -6,6 +6,8 @@ const navigationScenarios = { // YMMS SELECTED_YEAR: "SELECTED_YEAR", SELECTED_MAKE: "SELECTED_MAKE", + SELECTED_MODEL: "SELECTED_MODEL", + // TESTING CLICKED_TEST: "CLICKED_TEST" }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 5b56837d..1f5a87d5 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -26,10 +26,23 @@ const routingTable = function(store) { }, { scenario: navigationScenarios.SELECTED_MAKE, - destinationIssPageValue: issPageValues.WELCOME_PAGE + destinationIssPageValue: issPageValues.VEHICLE_MODEL }, ], }, + { + issPageValue: issPageValues.VEHICLE_MODEL, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationIssPageValue: issPageValues.VEHICLE_MAKE, + }, + { + scenario: navigationScenarios.SELC, + destinationUrl: "https://www.google.com" + } + ] + }, { issPageValue: issPageValues.WELCOME_PAGE, maps: [ diff --git a/src/store/index.js b/src/store/index.js index 7d3dca5b..a9c9acd8 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -91,6 +91,14 @@ export const useMainStore = defineStore({ }); }, + getVehicleModels() { + return globalMethods.callHttpClient({ + method: endpoints.GetVehicleModels.method, + endpoint: endpoints.GetVehicleModels.url + this.order.vehicle.year + this.order.vehicle.make, + payload: {}, + }); + }, + // Vehicle API Actions updateVehicleYear(year) { @@ -106,6 +114,13 @@ export const useMainStore = defineStore({ } }, + updateVehicleModel(model) + { + if (this.order.vehicle.model !== model) { + this.order.vehicle.model = model; + } + }, + // populate initial state populateInitialState() {