Skip to content

Commit

Permalink
Merge pull request #48 from ymaheshwari1/#24-updated
Browse files Browse the repository at this point in the history
Fixed: issue in sorting of inventory rules after update(#24)
  • Loading branch information
ymaheshwari1 authored Jan 29, 2024
2 parents ecf9b95 + 2d76d17 commit 335f932
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/store/modules/orderRouting/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ const actions: ActionTree<OrderRoutingState, RootState> = {
const rulesInformation = JSON.parse(JSON.stringify(state.rules))

// Do not fetch the rule information if its already available in state. This condition will be false on refresh as state will be cleared so automatically updated information will be fetched
if(rulesInformation[routingRuleId]) {
return rulesInformation[routingRuleId];
}
// commented this, as after update we currently do not update state locally and fetch the information again for getting latest information
// if(rulesInformation[routingRuleId]) {
// return rulesInformation[routingRuleId];
// }

try {
const resp = await OrderRoutingService.fetchRule(routingRuleId)
Expand Down
4 changes: 2 additions & 2 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ onIonViewWillEnter(async () => {
// Added check to not fetch any rule related information as when a new route will be created no rule will be available thus no need to fetch any other information
if(currentRouting.value["rules"]?.length) {
inventoryRules.value = JSON.parse(JSON.stringify(currentRouting.value["rules"]))
inventoryRules.value = sortSequence(JSON.parse(JSON.stringify(currentRouting.value["rules"])))
await fetchRuleInformation(inventoryRules.value[0].routingRuleId);
}
emitter.emit("dismissLoader")
Expand Down Expand Up @@ -886,7 +886,7 @@ async function save() {
// Added check to not fetch any rule related information as when a new route will be created no rule will be available thus no need to fetch any other information
if(currentRouting.value["rules"]?.length) {
inventoryRules.value = JSON.parse(JSON.stringify(currentRouting.value["rules"]))
inventoryRules.value = sortSequence(JSON.parse(JSON.stringify(currentRouting.value["rules"])))
await fetchRuleInformation(inventoryRules.value[0].routingRuleId);
}
emitter.emit("dismissLoader")
Expand Down

0 comments on commit 335f932

Please sign in to comment.