diff --git a/package-lock.json b/package-lock.json index 83f60911..0cb1a890 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3310,8 +3310,7 @@ "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" }, "default-gateway": { "version": "6.0.3", @@ -8684,6 +8683,11 @@ "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==", "dev": true }, + "shvl": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/shvl/-/shvl-2.0.3.tgz", + "integrity": "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw==" + }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -9508,6 +9512,15 @@ "@vue/devtools-api": "^6.0.0-beta.11" } }, + "vuex-persistedstate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz", + "integrity": "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ==", + "requires": { + "deepmerge": "^4.2.2", + "shvl": "^2.0.3" + } + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", diff --git a/package.json b/package.json index 04409aa6..f8c415c0 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "axios": "^0.27.2", "vue": "^3.2.13", "vue-router": "^4.0.3", - "vuex": "^4.0.0" + "vuex": "^4.0.0", + "vuex-persistedstate": "^4.1.0" }, "devDependencies": { "@vue/cli-plugin-router": "~5.0.0", diff --git a/src/store/index.js b/src/store/index.js index ab277921..02c9ab2e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -7,7 +7,7 @@ import globalMethods from "@/global-methods"; const getDefaultState = () => { return { // State ... - }, + }; }; export const state = getDefaultState(); @@ -15,12 +15,12 @@ export const state = getDefaultState(); // Export Mutations export const mutations = { // Mutations... -} +}; // Export Getters export const getters = { // Getters... -} +}; function getAllValuesOfPropertyInArrayOfObjects(array, propertyName) { return (array ?? []).map(x => x[propertyName]).filter(x => x); @@ -38,12 +38,14 @@ export const actions = { }, }); }, + getHomepageName(context) { return globalMethods.callHttpClient({ method: endpoints.GetHomepageInfo.method, endpoint: endpoints.GetHomepageInfo.url, }); }, + getPageData(context, { pageName }) { return globalMethods.callHttpClient({ method: endpoints.GetPageData.method, @@ -51,7 +53,7 @@ export const actions = { payload: {}, }); }, -} +}; export default createStore({ plugins: [createPersistedState()],