mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Merge branch 'main' into many-to-any
This commit is contained in:
@@ -267,7 +267,7 @@ function removeTemporaryFields(
|
||||
item[nestedCollection.fieldKey] = removeTemporaryFields(
|
||||
rawItem[nestedCollection.fieldKey],
|
||||
nestedCollection,
|
||||
nestedCollection.parentKey
|
||||
nestedCollection.relatedKey
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ export type M2ONode = {
|
||||
fieldKey: string;
|
||||
relation: Relation;
|
||||
parentKey: string;
|
||||
relatedKey: string;
|
||||
};
|
||||
|
||||
export type M2ANode = {
|
||||
@@ -20,6 +21,9 @@ export type M2ANode = {
|
||||
query: {
|
||||
[collection: string]: Query;
|
||||
};
|
||||
relatedKey: {
|
||||
[collection: string]: string;
|
||||
};
|
||||
fieldKey: string;
|
||||
relation: Relation;
|
||||
parentKey: string;
|
||||
@@ -33,6 +37,7 @@ export type O2MNode = {
|
||||
fieldKey: string;
|
||||
relation: Relation;
|
||||
parentKey: string;
|
||||
relatedKey: string;
|
||||
};
|
||||
|
||||
export type NestedCollectionNode = M2ONode | O2MNode | M2ANode;
|
||||
|
||||
@@ -131,6 +131,7 @@ export default async function getASTFromQuery(
|
||||
relation: relation,
|
||||
query: {},
|
||||
children: {},
|
||||
relatedKey: {},
|
||||
};
|
||||
|
||||
// for (const allowedCollection of allowedCollections) {
|
||||
@@ -144,6 +145,7 @@ export default async function getASTFromQuery(
|
||||
name: relatedCollection,
|
||||
fieldKey: relationalField,
|
||||
parentKey: await schemaInspector.primary(parentCollection),
|
||||
relatedKey: await schemaInspector.primary(relatedCollection),
|
||||
relation: relation,
|
||||
query: deep?.[relationalField] || {},
|
||||
children: await parseFields(relatedCollection, nestedFields),
|
||||
|
||||
Reference in New Issue
Block a user