mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix deep querying in nested o2m in m2a structure
This commit is contained in:
@@ -162,10 +162,12 @@ export default async function getASTFromQuery(
|
||||
for (const relatedCollection of allowedCollections) {
|
||||
child.children[relatedCollection] = await parseFields(
|
||||
relatedCollection,
|
||||
Array.isArray(nestedFields) ? nestedFields : (nestedFields as anyNested)[relatedCollection] || ['*']
|
||||
Array.isArray(nestedFields) ? nestedFields : (nestedFields as anyNested)[relatedCollection] || ['*'],
|
||||
deep?.[`${relationalField}:${relatedCollection}`]
|
||||
);
|
||||
|
||||
child.query[relatedCollection] = {};
|
||||
child.query[relatedCollection] = getDeepQuery(deep?.[`${relationalField}:${relatedCollection}`] || {});
|
||||
|
||||
child.relatedKey[relatedCollection] = schema.collections[relatedCollection].primary;
|
||||
}
|
||||
} else if (relatedCollection) {
|
||||
|
||||
Reference in New Issue
Block a user