mirror of
https://github.com/directus/directus.git
synced 2026-01-24 17:37:59 -05:00
Fix deep recursive m2o temp filtering
This commit is contained in:
@@ -201,7 +201,7 @@ function removeTemporaryFields(rawItems: Item[], ast: AST | NestedCollectionAST)
|
||||
const item = fields.includes('*') ? rawItem : pick(rawItem, fields);
|
||||
|
||||
for (const nestedCollection of nestedCollections) {
|
||||
item[nestedCollection.fieldKey] = removeTemporaryFields(rawItem[nestedCollection.fieldKey], nestedCollection);
|
||||
item[nestedCollection.fieldKey] = removeTemporaryFields(Array.isArray(rawItem[nestedCollection.fieldKey]) ? rawItem[nestedCollection.fieldKey] : [rawItem[nestedCollection.fieldKey]], nestedCollection);
|
||||
|
||||
if (isM2O(nestedCollection)) {
|
||||
item[nestedCollection.fieldKey] = item[nestedCollection.fieldKey][0] || null;
|
||||
|
||||
Reference in New Issue
Block a user