fix(block-provider): getNesterAppends filter fix (#1839)

* fix: getNesterAppends filter bug

* fix: associationSelect
This commit is contained in:
katherinehhh 2023-05-11 15:45:47 +08:00 committed by GitHub
parent f8fa36d016
commit a7dcbf4288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1097,7 +1097,7 @@ export const useAssociationNames = (collection) => {
}, new Schema({})); }, new Schema({}));
const getAssociationAppends = (schema, arr = []) => { 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']); const collectionfield = s['x-collection-field'] && getCollectionJoinField(s['x-collection-field']);
if ( if (
collectionfield && collectionfield &&
@ -1121,7 +1121,9 @@ export const useAssociationNames = (collection) => {
} }
} }
}, arr); }, arr);
return data || [];
}; };
function flattenNestedList(nestedList) { function flattenNestedList(nestedList) {
const flattenedList = []; const flattenedList = [];
function flattenHelper(list, prefix) { function flattenHelper(list, prefix) {

View File

@ -74,7 +74,7 @@ const InternalAssociationSelect = observer((props: AssociationSelectProps) => {
</Input.Group> </Input.Group>
<ActionContext.Provider value={{ openMode: 'drawer', visible: visibleAddNewer, setVisible: setVisibleAddNewer }}> <ActionContext.Provider value={{ openMode: 'drawer', visible: visibleAddNewer, setVisible: setVisibleAddNewer }}>
<CollectionProvider name={collectionField.target}> <CollectionProvider name={collectionField?.target}>
<RecursionField <RecursionField
onlyRenderProperties onlyRenderProperties
basePath={field.address} basePath={field.address}