Fix deep groupBy (#9996)

* fix deep _groupBy not turning to _group

* add groupBy to roles user count

* Revert "add groupBy to roles user count"

This reverts commit 16340eef5a.
This commit is contained in:
Azri Kahar
2021-11-25 06:14:29 +08:00
committed by GitHub
parent b55abff734
commit 19906d0501

View File

@@ -194,7 +194,8 @@ function sanitizeDeep(deep: Record<string, any>, accountability?: Accountability
const parsedSubQuery = sanitizeQuery({ [key.substring(1)]: value }, accountability);
// ...however we want to keep them for the nested structure of deep, otherwise there's no
// way of knowing when to keep nesting and when to stop
parsedLevel[key] = Object.values(parsedSubQuery)[0];
const [parsedKey, parsedValue] = Object.entries(parsedSubQuery)[0];
parsedLevel[`_${parsedKey}`] = parsedValue;
} else {
parse(value, [...path, key]);
}