feat: added comment to better explain the logic

This commit is contained in:
SagarRajput-7 2025-05-28 18:54:04 +05:30
parent c0beba6ef0
commit 33df34a432

View File

@ -205,6 +205,9 @@ export const useQueryOperations: UseQueryOperations = ({
newQuery.spaceAggregation = '';
// Handled query with unknown metric to avoid 400 and 500 errors
// With metric value typed and not available then - time - 'avg', space - 'avg'
// If not typed - time - 'rate', space - 'sum', op - 'count'
if (isEmpty(newQuery.aggregateAttribute.type)) {
if (!isEmpty(newQuery.aggregateAttribute.key)) {
newQuery.aggregateOperator = MetricAggregateOperator.AVG;