Skip to content

Commit

Permalink
Merge pull request #455 from R-Sourabh/dxp-345-product-identifier-opt…
Browse files Browse the repository at this point in the history
…ions

Improved: Passed method to fetch good identification types in order to display product identifier options dynamically(dxp-345)
  • Loading branch information
ravilodhi authored Oct 25, 2024
2 parents 36d417e + 33ecf2b commit 09aecf9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
getConfig,
getNotificationEnumIds,
getNotificationUserPrefTypeIds,
fetchGoodIdentificationTypes,
getProductIdentificationPref,
getUserFacilities,
hasError,
Expand All @@ -28,6 +29,7 @@ export {
getConfig,
getNotificationEnumIds,
getNotificationUserPrefTypeIds,
fetchGoodIdentificationTypes,
getProductIdentificationPref,
getUserFacilities,
hasError,
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ const actions: ActionTree<UserState, RootState> = {
* 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);
Expand All @@ -184,7 +185,7 @@ const actions: ActionTree<UserState, RootState> = {
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)
Expand Down

0 comments on commit 09aecf9

Please sign in to comment.