From 06d65c9a4b1e827a87fa60332fedeb2b30265cc8 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 9 Jan 2024 15:45:48 +0530 Subject: [PATCH] Fixed: productIdentifier failing on login (dxp-178) --- src/main.ts | 2 +- src/store/modules/user/actions.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6268df87..832b6199 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,7 +33,7 @@ import permissionRules from '@/authorization/Rules'; import permissionActions from '@/authorization/Actions'; import { dxpComponents } from '@hotwax/dxp-components' import { login, logout, loader } from './user-utils'; -import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref } from './adapter'; +import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref } from '@/adapter'; const app = createApp(App) .use(IonicVue, { diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 4434a096..d1e31b98 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -76,10 +76,6 @@ const actions: ActionTree = { const currentEComStore = await UserService.getCurrentEComStore(token, currentFacility?.facilityId); const currentQOHViewConfig = await UserService.getQOHViewConfig(token, currentEComStore?.productStoreId); - // Get product identification from api using dxp-component - await useProductIdentificationStore().getIdentificationPref(currentEComStore?.productStoreId) - .catch((error) => console.error(error)); - /* ---- Guard clauses ends here --- */ setPermissions(appPermissions); @@ -95,6 +91,10 @@ const actions: ActionTree = { commit(types.USER_PERMISSIONS_UPDATED, appPermissions); commit(types.USER_VIEW_QOH_CNFG_UPDATED, { currentQOHViewConfig, viewQOH: currentQOHViewConfig.settingValue == "true" }) commit(types.USER_TOKEN_CHANGED, { newToken: token }) + + // Get product identification from api using dxp-component + await useProductIdentificationStore().getIdentificationPref(currentEComStore?.productStoreId) + .catch((error) => console.error(error)); } catch (err: any) { // If any of the API call in try block has status code other than 2xx it will be handled in common catch block. // TODO Check if handling of specific status codes is required.