Skip to content

Commit

Permalink
Merge pull request #111 from ymaheshwari1/#106
Browse files Browse the repository at this point in the history
Improved: handling when failed to fetch the routing Rule information(#106)
  • Loading branch information
ymaheshwari1 authored Feb 16, 2024
2 parents ae7efa7 + 32247c5 commit 0d6d665
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]?.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 0d6d665

Please sign in to comment.