Add table prefix to groupBy query (#10250)

Fixes #10092
This commit is contained in:
Rijk van Zanten
2021-12-02 19:28:25 -05:00
committed by GitHub
parent 57bddf9c65
commit a77f08b3d3
2 changed files with 3 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ export default function applyQuery(
}
if (query.group) {
dbQuery.groupBy(query.group.map(applyFunctionToColumnName));
dbQuery.groupBy(`${collection}.${query.group.map(applyFunctionToColumnName)}`);
}
if (query.aggregate) {

View File

@@ -1,4 +1,4 @@
import { flatten, get, merge, set } from 'lodash';
import { flatten, get, isPlainObject, merge, set } from 'lodash';
import logger from '../logger';
import { Meta } from '../types';
import { Query, Aggregate, Filter } from '@directus/shared/types';
@@ -184,7 +184,7 @@ function sanitizeDeep(deep: Record<string, any>, accountability?: Accountability
// way of knowing when to keep nesting and when to stop
const [parsedKey, parsedValue] = Object.entries(parsedSubQuery)[0];
parsedLevel[`_${parsedKey}`] = parsedValue;
} else {
} else if (isPlainObject(value)) {
parse(value, [...path, key]);
}
}