mirror of
https://github.com/directus/directus.git
synced 2026-01-23 06:28:20 -05:00
Fix shared fields in m2a fetch
This commit is contained in:
@@ -143,8 +143,6 @@ export default async function getASTFromQuery(
|
||||
}
|
||||
}
|
||||
|
||||
console.log(relationalStructure);
|
||||
|
||||
for (const [relationalField, nestedFields] of Object.entries(relationalStructure)) {
|
||||
const relatedCollection = getRelatedCollection(parentCollection, relationalField);
|
||||
const relation = getRelation(parentCollection, relationalField);
|
||||
@@ -185,7 +183,9 @@ export default async function getASTFromQuery(
|
||||
for (const relatedCollection of allowedCollections) {
|
||||
child.children[relatedCollection] = await parseFields(
|
||||
relatedCollection,
|
||||
(nestedFields as anyNested)[relatedCollection] || null
|
||||
Array.isArray(nestedFields)
|
||||
? nestedFields
|
||||
: (nestedFields as anyNested)[relatedCollection] || ['*']
|
||||
);
|
||||
child.query[relatedCollection] = {};
|
||||
child.relatedKey[relatedCollection] = schema[relatedCollection].primary;
|
||||
|
||||
Reference in New Issue
Block a user