[Metrics Alerts] Fix saving doc count alerts(#63750)

This commit is contained in:
Zacqary Adam Xeper 2020-04-17 12:13:29 -05:00 committed by GitHub
parent 2af91b3c51
commit 980e58e5fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -378,7 +378,11 @@ export const ExpressionRow: React.FC<ExpressionRowProps> = props => {
const updateAggType = useCallback(
(at: string) => {
setAlertParams(expressionId, { ...expression, aggType: at as MetricExpression['aggType'] });
setAlertParams(expressionId, {
...expression,
aggType: at as MetricExpression['aggType'],
metric: at === 'count' ? undefined : expression.metric,
});
},
[expressionId, expression, setAlertParams]
);