Skip to content

Commit

Permalink
Improved: handling when failed to fetch the routing Rule information(#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Feb 16, 2024
1 parent 894b2b1 commit 8b48f07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ async function fetchRuleInformation(routingRuleId: string) {
// Using currentRouting["rules"] deep-cloned object here, as we will update the change in rules with route changes and not with rules filter changes
selectedRoutingRule.value = inventoryRules.value.find((rule: Rule) => rule.routingRuleId === routingRuleId)
// Even after fetching the rule is not found then initializing the selectedRouting to empty object
if(!selectedRoutingRule.value) {
// If failed to fetch the current routing rule information
if(!selectedRoutingRule.value || !rulesInformation.value[routingRuleId]) {
selectedRoutingRule.value = {}
}
Expand Down Expand Up @@ -516,7 +516,7 @@ async function addInventoryRule() {
const routingRuleId = await store.dispatch("orderRouting/createRoutingRule", payload)
if(routingRuleId) {
// TODO: Fix warning of duplicate keys when creating a new rule
inventoryRules.value = JSON.parse(JSON.stringify(currentRouting.value["rules"]))
inventoryRules.value = sortSequence(JSON.parse(JSON.stringify(currentRouting.value["rules"])))
fetchRuleInformation(routingRuleId)
}
}
Expand Down

0 comments on commit 8b48f07

Please sign in to comment.