mirror of
https://github.com/directus/directus.git
synced 2026-02-03 22:44:56 -05:00
Fix deep filters in app, fix current-user/current-role in filters
This commit is contained in:
@@ -13,7 +13,18 @@ export default function filtersToQuery(filters: readonly Filter[]) {
|
||||
|
||||
if (!value) continue;
|
||||
|
||||
filterList.push({ [field]: { [`_${operator}`]: value } });
|
||||
if (field.includes('.')) {
|
||||
let filter: Record<string, any> = { [`_${operator}`]: value };
|
||||
const path = field.split('.');
|
||||
|
||||
for (const field of path.reverse()) {
|
||||
filter = { [field]: filter };
|
||||
}
|
||||
|
||||
filterList.push(filter);
|
||||
} else {
|
||||
filterList.push({ [field]: { [`_${operator}`]: value } });
|
||||
}
|
||||
}
|
||||
|
||||
let filterQuery: Record<string, any> = {};
|
||||
|
||||
Reference in New Issue
Block a user