Skip to content

Commit

Permalink
[ML] fix updateSubAggregation validation
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jun 8, 2020
1 parent 355b76a commit 83e7477
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,18 @@ export const usePivotConfig = (
throw new Error('No parent aggregation reference found');
}

const { [prevSubItemName]: deleted, ...newSubAgg } = parent.subAggs;

const aggNameConflictMessages = getAggNameConflictToastMessages(
subItem.aggName,
parent.subAggs,
newSubAgg,
{}
);
if (aggNameConflictMessages.length > 0) {
aggNameConflictMessages.forEach((m) => toastNotifications.addDanger(m));
return;
}

const { [prevSubItemName]: deleted, ...newSubAgg } = parent.subAggs;
parent.subAggs = {
...newSubAgg,
[subItem.aggName]: subItem,
Expand Down

0 comments on commit 83e7477

Please sign in to comment.