diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index 3d7c96f418..530836b480 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -1097,7 +1097,7 @@ export const useAssociationNames = (collection) => { }, new Schema({})); const getAssociationAppends = (schema, arr = []) => { - return schema.reduceProperties((buf, s) => { + const data = schema.reduceProperties((buf, s) => { const collectionfield = s['x-collection-field'] && getCollectionJoinField(s['x-collection-field']); if ( collectionfield && @@ -1121,7 +1121,9 @@ export const useAssociationNames = (collection) => { } } }, arr); + return data || []; }; + function flattenNestedList(nestedList) { const flattenedList = []; function flattenHelper(list, prefix) { diff --git a/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx b/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx index a07444a692..50bb5a5c08 100644 --- a/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/AssociationSelect.tsx @@ -74,7 +74,7 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => { - +