commit
This commit is contained in:
parent
45981d3ce2
commit
f8b4136070
3 changed files with 27 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ export default {
|
|||
callHttpClient({ method, endpoint, payload}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
||||
const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "FixMyGlass" });
|
||||
const payloadAndAnalyticsData = Object.assign({}, payload, { AppName: "SelfService" });
|
||||
|
||||
axios({ method: method, url: cfDistroUrl + endpoint, data: payloadAndAnalyticsData, crossDomain: true, responseType: {}})
|
||||
.then((response) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { storeActions } from "@/constants/store-actions";
|
||||
import { storeMutations } from "@/constants/store-mutations";
|
||||
import { createWebHistory, createRouter } from "vue-router";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
|
|
@ -38,6 +40,27 @@ const router = createRouter({
|
|||
routes,
|
||||
});
|
||||
|
||||
// Get route information by page name.
|
||||
// This will reach out to the Cms and there is a 1:1 relationship between page names and route names.
|
||||
async function GetRouteInfoFromPageName(pageName) {
|
||||
const response = await store.dispatch(storeActions.GET_ROUTE_INFO_ACTION, {
|
||||
pageName: pageName,
|
||||
});
|
||||
const jsonFromResponse = JSON.parse(response.data.Result);
|
||||
let routeData = [];
|
||||
|
||||
// Add our route data and return our array.
|
||||
Object.keys(jsonFromResponse).forEach((key) => {
|
||||
routeData.push({
|
||||
path: "/",
|
||||
name: `${key}`,
|
||||
component: lazyLoadComponent(jsonFromResponse[key].LayoutName),
|
||||
});
|
||||
});
|
||||
|
||||
return routeData;
|
||||
}
|
||||
|
||||
// Navigate to the next route, depending on the scenario.
|
||||
async function navigate(scenario, currentRoute, optionalQuery = {}, optionalParams = {}) {
|
||||
if (!scenario) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ import { createStore } from "vuex";
|
|||
import { endpoints } from "@/constants/endpoints.js";
|
||||
import createPersistedState from "vuex-persistedstate";
|
||||
import globalMethods from "@/global-methods";
|
||||
import { storeActions } from "@/constants/store-actions";
|
||||
import { applicationConfig } from "@/constants/application-config";
|
||||
import { issPageValues } from "@/router/router-constants/issPage-values";
|
||||
|
||||
// Export State
|
||||
const getDefaultState = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue