diff --git a/src/store/modules/orderRouting/actions.ts b/src/store/modules/orderRouting/actions.ts index a7aeb92..bf6eb73 100644 --- a/src/store/modules/orderRouting/actions.ts +++ b/src/store/modules/orderRouting/actions.ts @@ -177,7 +177,7 @@ const actions: ActionTree = { async createRoutingRule({ commit, state }, payload) { const currentRoute = JSON.parse(JSON.stringify(state.currentRoute)) - let routingRules = currentRoute.rules?.length ? currentRoute.rules : [] + let routingRules = currentRoute.rules?.length ? JSON.parse(JSON.stringify(currentRoute.rules)) : [] let routingRuleId = '' try { @@ -197,6 +197,7 @@ const actions: ActionTree = { routingRules = sortSequence(routingRules) } + currentRoute["rules"] = routingRules commit(types.ORDER_ROUTING_CURRENT_ROUTE_UPDATED, currentRoute) } } catch(err) { diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index f058da6..abc2bad 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -494,6 +494,10 @@ function updatePartialAllocation(checked: any) { } function isPromiseDateFilterApplied() { + if(!currentRouting.value["rules"]?.length) { + return; + } + const filter = getFilterValue(orderRoutingFilterOptions.value, ruleEnums, 'PROMISE_DATE') // When promise date range is selected for order filter, we will revert any change made to the partialAllocation enum and will change it to its initial value and will disable the partial allocation feature @@ -862,11 +866,11 @@ async function save() { const rule = rulesDiff[key] if(rule.filtersToRemove?.length) { - await store.dispatch("orderRouting/deleteRuleConditions", rule.filtersToRemove) + await store.dispatch("orderRouting/deleteRuleConditions", { routingRuleId: rule.routingRuleId, conditions: rule.filtersToRemove }) } if(rule.actionsToRemove?.length) { - await store.dispatch("orderRouting/deleteRuleActions", rule.actionsToRemove) + await store.dispatch("orderRouting/deleteRuleActions", { routingRuleId: rule.routingRuleId, actions: rule.actionsToRemove }) } if(rule.filtersToUpdate?.length || rule.actionsToUpdate?.length) {