Skip to content

Commit

Permalink
Fixed: inventory filters not displayed after moving back and forth to…
Browse files Browse the repository at this point in the history
… the rules page(#146)

When creating multiple rules and saving their filters at once, and if moving to the route page and again coming to the rules page, it displays the data from the state instead of fetching the latest information, thus added an action to clear the rules once the page is left so that always the latest information for the rules is fetched
  • Loading branch information
ymaheshwari1 committed Apr 3, 2024
1 parent c13ca23 commit 4efc7a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/store/modules/orderRouting/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ const actions: ActionTree<OrderRoutingState, RootState> = {

async clearRouting({ commit }) {
commit(types.ORDER_ROUTING_CLEARED)
},

async clearRules({ commit }) {
commit(types.ORDER_ROUTING_RULES_UPDATED, {})
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ onBeforeRouteLeave(async (to) => {
if(!hasUnsavedChanges.value) {
// clearning the selected ruleId whenever user tries to leave the page, we need to clear this id, as if user opens some other routing then the id will not be found which will result in an empty state scenario
store.dispatch("orderRouting/updateRoutingRuleId", "")
store.dispatch("orderRouting/clearRules", "")
return;
}
Expand All @@ -348,6 +349,7 @@ onBeforeRouteLeave(async (to) => {
handler: () => {
// clearning the selected ruleId whenever user leaves the page, we need to clear this id, as if user opens some other routing then the id will not be found which will result in an empty state scenario
store.dispatch("orderRouting/updateRoutingRuleId", "")
store.dispatch("orderRouting/clearRules", "")
canLeave = true;
},
},
Expand Down

0 comments on commit 4efc7a2

Please sign in to comment.