Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineComponent({
...mapGetters({
userToken: 'user/getUserToken',
instanceUrl: 'user/getInstanceUrl',
currentEComStore: 'user/getCurrentEComStore'
currentProductStore: 'user/getCurrentProductStore'
})
},
methods: {
Expand Down Expand Up @@ -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));
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const getUserPermissions = async (payload: any, token: any): Promise<any> => {
}
}

const getCurrentEComStore = async (token: any, facilityId: any): Promise<any> => {
const getCurrentProductStore = async (token: any, facilityId: any): Promise<any> => {

// If the facilityId is not provided, it may be case of user not associated with any facility or the logout
if (!facilityId) {
Expand Down Expand Up @@ -167,6 +167,6 @@ export const UserService = {
getAvailableTimeZones,
getProfile,
setUserTimeZone,
getCurrentEComStore,
getCurrentProductStore,
getUserPermissions
}
2 changes: 1 addition & 1 deletion src/store/modules/user/UserState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default interface UserState {
instanceUrl: string;
picklistItemSortBy: string;
pwaState: any;
currentEComStore: any;
currentProductStore: any;
permissions: any;
}
12 changes: 6 additions & 6 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ const actions: ActionTree<UserState, RootState> = {
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));
}
},
Expand All @@ -161,10 +161,10 @@ const actions: ActionTree<UserState, RootState> = {
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));
},

Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/user/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const getters: GetterTree <UserState, RootState> = {
getUserProfile (state) {
return state.current
},
getCurrentEComStore(state) {
return state.currentEComStore;
getCurrentProductStore(state) {
return state.currentProductStore;
},
getCurrentFacility (state) {
return state.currentFacility;
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const userModule: Module<UserState, RootState> = {
state: {
token: '',
current: null,
currentEComStore: {},
currentProductStore: {},
currentFacility: {},
instanceUrl: '',
picklistItemSortBy: 'productName',
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/user/mutation-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions src/store/modules/user/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const mutations: MutationTree <UserState> = {
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
Expand Down
Loading