diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index db610a8e..8b0e2471 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -168,13 +168,13 @@ const actions: ActionTree = { }, async updateCurrentFacility({ dispatch }, facility) { - const previousEComStoreId = getProductStoreId() + const previousProductStoreId = getProductStoreId() const userProfile = store.getters["user/getUserProfile"] await useUserStore().getEComStoresByFacility(facility.facilityId); await useUserStore().getEComStorePreference('SELECTED_BRAND', userProfile.userId); const preferredStore: any = useUserStore().getCurrentEComStore - if(previousEComStoreId !== preferredStore.productStoreId) { + if(previousProductStoreId !== preferredStore.productStoreId) { dispatch("getProductStoreSetting", preferredStore.productStoreId) await useProductIdentificationStore().getIdentificationPref(preferredStore.productStoreId) .catch((error) => logger.error(error)); @@ -231,14 +231,14 @@ const actions: ActionTree = { }, async createProductStoreSetting({ commit }, payload) { - const eComStoreId = getProductStoreId(); + const productStoreId = getProductStoreId(); let isSettingExists = false; let settingValue = false as any; if(payload.enumId === "BARCODE_IDEN_PREF") settingValue = "internalName" const params = { - "productStoreId": eComStoreId, + "productStoreId": productStoreId, "settingTypeEnumId": payload.enumId, settingValue } @@ -257,7 +257,7 @@ const actions: ActionTree = { }, async setProductStoreSetting({ commit, dispatch, state }, payload) { - const eComStoreId = getProductStoreId(); + const productStoreId = getProductStoreId(); let prefValue = (state.settings as any)[payload.key] let enumId = ""; @@ -303,7 +303,7 @@ const actions: ActionTree = { } const params = { - "productStoreId": eComStoreId, + "productStoreId": productStoreId, "settingTypeEnumId": enumId, "settingValue": payload.key !== "barcodeIdentificationPref" ? JSON.stringify(payload.value) : payload.value } diff --git a/src/utils/index.ts b/src/utils/index.ts index cbf76f40..1d30d60e 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -184,8 +184,8 @@ function sortListByField(list: any, field = "parentProductName") { } const getProductStoreId = () => { - const currentEComStore: any = useUserStore().getCurrentEComStore; - return currentEComStore.productStoreId + const currentProductStore: any = useUserStore().getCurrentEComStore; + return currentProductStore.productStoreId }; export { convertIsoToMillis, downloadCsv, jsonToCsv, showToast, hasError, handleDateTimeInput, getCycleCountStats, getDateTime, getDateWithOrdinalSuffix, getDerivedStatusForCount, getFacilityName, getPartyName, getProductIdentificationValue, getProductStoreId, timeFromNow, parseCsv, sortListByField }