From 33ecf2bfc6310e0460a56e3925ccae22fdfecaf1 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Fri, 25 Oct 2024 14:36:12 +0530 Subject: [PATCH] Improved: Passed method to fetch good identification types in order to display product identifier options dynamically(dxp-345) - updated the oms-api & dxp-components package to latest release and passed token explicitly in the client method when fetching ecom stores. --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- src/adapter/index.ts | 2 ++ src/main.ts | 3 ++- src/store/modules/user/actions.ts | 3 ++- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index abc17d0f5..388e113f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.4", - "@hotwax/oms-api": "^1.14.0", + "@hotwax/dxp-components": "^1.15.5", + "@hotwax/oms-api": "^1.16.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", "@ionic/vue-router": "^7.6.0", @@ -2807,9 +2807,9 @@ "integrity": "sha512-zpUjGoY7LBlKeiP0V7tonrmoey8HQ5THQmyixQ+IDtrjmEJNBjynW/Ef3gC0FUNNPuVqxWPZdT5CVgaETLGTwg==" }, "node_modules/@hotwax/dxp-components": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.4.tgz", - "integrity": "sha512-dlgexo/QBLnLlPkq1zwfWBIPiVtmZKsRcPcCAwe+eFz9qPwyQORdzKb6YjX1WgtRU72GYMv345eA+HuaSY6H5w==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.15.5.tgz", + "integrity": "sha512-aOzipZwVk/fL6K7/BShsvE3eYqH8LagEQQpaNCPFtSs18KHgolGQxcKT3dQ1KRLTCmoKJugc7ut9uyxZVL5krg==", "dependencies": { "@hotwax/oms-api": "^1.8.1", "@ionic/core": "^7.6.0", @@ -2883,9 +2883,9 @@ } }, "node_modules/@hotwax/oms-api": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.14.0.tgz", - "integrity": "sha512-dYkrFEi0oJHKiJ/VctKmyIY4WTVV2lmljm1EflgQ/LM7BTJ9jVEeT1zgYJ5vO906kW7SWM4pl7mZI3dDCt1YCQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.16.0.tgz", + "integrity": "sha512-WZ3v0TxcHz5UZEBDX+GvZd/cqD08Kws42kGcseN2tfNf5kKWbfaDgWm6KEaBxLFuVBPBdRelRZhGj/nRIxBgGw==", "dependencies": { "@types/node-json-transform": "^1.0.0", "axios": "^0.21.1", diff --git a/package.json b/package.json index f28ae0d08..c77803ad4 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.6", - "@hotwax/dxp-components": "^1.15.4", - "@hotwax/oms-api": "^1.14.0", + "@hotwax/dxp-components": "^1.15.5", + "@hotwax/oms-api": "^1.16.0", "@ionic/core": "^7.6.0", "@ionic/vue": "^7.6.0", "@ionic/vue-router": "^7.6.0", diff --git a/src/adapter/index.ts b/src/adapter/index.ts index db46dfd69..912c83bc3 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -4,6 +4,7 @@ import { getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, + fetchGoodIdentificationTypes, getProductIdentificationPref, getUserFacilities, hasError, @@ -28,6 +29,7 @@ export { getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, + fetchGoodIdentificationTypes, getProductIdentificationPref, getUserFacilities, hasError, diff --git a/src/main.ts b/src/main.ts index 2860cc564..2e6886eab 100644 --- a/src/main.ts +++ b/src/main.ts @@ -36,7 +36,7 @@ import { dxpComponents } from '@hotwax/dxp-components' import localeMessages from './locales'; import { login, logout, loader } from '@/utils/user'; import { addNotification, storeClientRegistrationToken } from '@/utils/firebase'; -import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref, setUserLocale, getAvailableTimeZones, setUserTimeZone } from '@/adapter'; +import { getConfig, fetchGoodIdentificationTypes, getProductIdentificationPref, initialise, setProductIdentificationPref, setUserLocale, getAvailableTimeZones, setUserTimeZone } from '@/adapter'; import logger from './logger'; const app = createApp(App) @@ -61,6 +61,7 @@ const app = createApp(App) appFirebaseVapidKey: process.env.VUE_APP_FIREBASE_VAPID_KEY, defaultImgUrl: require("@/assets/images/defaultImage.png"), getConfig, + fetchGoodIdentificationTypes, getProductIdentificationPref, initialise, loader, diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index abdebfade..a495d6ada 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -176,6 +176,7 @@ const actions: ActionTree = { * update current facility information */ async setFacility ({ commit, dispatch, state }, payload) { + const token = store.getters['user/getUserToken']; let facility = payload.facility; if(!facility && state.current?.facilities) { facility = state.current.facilities.find((facility: any) => facility.facilityId === payload.facilityId); @@ -184,7 +185,7 @@ const actions: ActionTree = { dispatch("order/clearOrders", null, {root: true}) dispatch("product/clearProducts", null, {root: true}) commit(types.USER_CURRENT_FACILITY_UPDATED, facility); - const eComStore = await UserService.getCurrentEComStore(undefined, facility?.facilityId); + const eComStore = await UserService.getCurrentEComStore(token, facility?.facilityId); commit(types.USER_CURRENT_ECOM_STORE_UPDATED, eComStore) await useProductIdentificationStore().getIdentificationPref(eComStore?.productStoreId)