diff --git a/src/App.vue b/src/App.vue index 55eeb05..a1ed954 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,7 +30,7 @@ export default defineComponent({ ...mapGetters({ userToken: 'user/getUserToken', instanceUrl: 'user/getInstanceUrl', - currentEComStore: 'user/getCurrentEComStore' + currentProductStore: 'user/getCurrentProductStore' }) }, methods: { @@ -89,7 +89,7 @@ export default defineComponent({ if(this.userToken) { // Get product identification from api using dxp-component - await useProductIdentificationStore().getIdentificationPref(this.currentEComStore?.productStoreId) + await useProductIdentificationStore().getIdentificationPref(this.currentProductStore?.productStoreId) .catch((error) => console.error(error)); } }, diff --git a/src/services/UserService.ts b/src/services/UserService.ts index 18f2d58..da41f16 100644 --- a/src/services/UserService.ts +++ b/src/services/UserService.ts @@ -101,7 +101,7 @@ const getUserPermissions = async (payload: any, token: any): Promise => { } } -const getCurrentEComStore = async (token: any, facilityId: any): Promise => { +const getCurrentProductStore = async (token: any, facilityId: any): Promise => { // If the facilityId is not provided, it may be case of user not associated with any facility or the logout if (!facilityId) { @@ -167,6 +167,6 @@ export const UserService = { getAvailableTimeZones, getProfile, setUserTimeZone, - getCurrentEComStore, + getCurrentProductStore, getUserPermissions } \ No newline at end of file diff --git a/src/store/modules/user/UserState.ts b/src/store/modules/user/UserState.ts index 7c00c46..d4b8a03 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -5,6 +5,6 @@ export default interface UserState { instanceUrl: string; picklistItemSortBy: string; pwaState: any; - currentEComStore: any; + currentProductStore: any; permissions: any; } \ No newline at end of file diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index f3cc8e0..d0b3aeb 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -133,11 +133,11 @@ const actions: ActionTree = { commit(types.USER_CURRENT_FACILITY_UPDATED, currentFacility); // get and set current ecom store in state - const currentEComStore = await UserService.getCurrentEComStore(token, currentFacility?.facilityId); - commit(types.USER_CURRENT_ECOM_STORE_UPDATED, currentEComStore); + const currentProductStore = await UserService.getCurrentProductStore(token, currentFacility?.facilityId); + commit(types.USER_CURRENT_PRODUCT_STORE_UPDATED, currentProductStore); // Get product identification from api using dxp-component - await useProductIdentificationStore().getIdentificationPref(currentEComStore?.productStoreId) + await useProductIdentificationStore().getIdentificationPref(currentProductStore?.productStoreId) .catch((error) => console.error(error)); } }, @@ -161,10 +161,10 @@ const actions: ActionTree = { commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); // get and set current ecom store in state - const currentEComStore = await UserService.getCurrentEComStore(state.token, payload.facility.facilityId); - commit(types.USER_CURRENT_ECOM_STORE_UPDATED, currentEComStore); + const currentProductStore = await UserService.getCurrentProductStore(state.token, payload.facility.facilityId); + commit(types.USER_CURRENT_PRODUCT_STORE_UPDATED, currentProductStore); - await useProductIdentificationStore().getIdentificationPref(currentEComStore?.productStoreId) + await useProductIdentificationStore().getIdentificationPref(currentProductStore?.productStoreId) .catch((error) => console.error(error)); }, diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index 13bff11..583db21 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -15,8 +15,8 @@ const getters: GetterTree = { getUserProfile (state) { return state.current }, - getCurrentEComStore(state) { - return state.currentEComStore; + getCurrentProductStore(state) { + return state.currentProductStore; }, getCurrentFacility (state) { return state.currentFacility; diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index b3cabe8..e9c1619 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -10,7 +10,7 @@ const userModule: Module = { state: { token: '', current: null, - currentEComStore: {}, + currentProductStore: {}, currentFacility: {}, instanceUrl: '', picklistItemSortBy: 'productName', diff --git a/src/store/modules/user/mutation-types.ts b/src/store/modules/user/mutation-types.ts index dd292bc..ecc69af 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -6,5 +6,5 @@ export const USER_CURRENT_FACILITY_UPDATED = SN_USER + '/CURRENT_FACILITY_UPDATE export const USER_INSTANCE_URL_UPDATED = SN_USER + '/INSTANCE_URL_UPDATED' export const USER_SORTBY_UPDATED = SN_USER + '/SORTBY_UPDATED' export const USER_PWA_STATE_UPDATED = SN_USER + '/PWA_STATE_UPDATED' -export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED' +export const USER_CURRENT_PRODUCT_STORE_UPDATED = SN_USER + '/CURRENT_PRODUCT_STORE_UPDATED' export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' diff --git a/src/store/modules/user/mutations.ts b/src/store/modules/user/mutations.ts index 6748df1..18d0e16 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -27,8 +27,8 @@ const mutations: MutationTree = { state.pwaState.registration = payload.registration; state.pwaState.updateExists = payload.updateExists; }, - [types.USER_CURRENT_ECOM_STORE_UPDATED] (state, payload) { - state.currentEComStore = payload + [types.USER_CURRENT_PRODUCT_STORE_UPDATED] (state, payload) { + state.currentProductStore = payload }, [types.USER_PERMISSIONS_UPDATED](state, payload) { state.permissions = payload