-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented: Added the support for using facility selector from dxp-component(#dxp/228) #753
Conversation
…omponent(dxp/228)
…edFacility to getFacilityPreference
…p-component version to latest and changed the emitted updateFacilty function name(#dxp/288)
src/store/modules/stock/actions.ts
Outdated
|
||
const actions: ActionTree<StockState, RootState> = { | ||
async fetchStock({ commit }, { productId, facilityId = '' }) { | ||
const id = facilityId ? facilityId : this.state.user.currentFacility.facilityId | ||
const getCurrentFacility: any = useUserStore().getCurrentFacility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use getCurrentFacilityId() util function here.
|
||
const getters: GetterTree <StockState, RootState> = { | ||
getProductStock: (state, getters, RootState) => (productId: any, facilityId?: any) => { | ||
const id = facilityId ? facilityId : RootState.user.currentFacility.facilityId | ||
getProductStock: (state, getters) => (productId: any, facilityId?: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the getCurrentFacilityId() util function here.
@@ -18,6 +18,7 @@ const actions: ActionTree<TransferOrderState, RootState> = { | |||
emitter.emit('presentLoader'); | |||
let resp; | |||
const transferOrderQuery = JSON.parse(JSON.stringify(state.transferOrder.query)) | |||
const currentFacilityId = getCurrentFacilityId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the getCurrentFacilityId() directly if currentFacilityId variable is not reused.
…lity instead of useUserStore from dxp-component in various files(#dxp/288)
…lity instead of useUserStore from dxp-component in various files(#dxp/288)
Related Issues
hotwax/dxp-components#228
Short Description and Why It's Useful
facility selector
on the settings page from thedxp-component
.state
management.getters
from the user store in dxp-components across the entire application.Contribution and Currently Important Rules Acceptance