fix: table column field undefined fix (#2311)

This commit is contained in:
katherinehhh 2023-07-25 09:23:32 +08:00 committed by GitHub
parent d068f9b5df
commit 4a7e44f686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ export const ColumnFieldProvider = observer(
return buf;
}, null);
const collectionField = fieldSchema && getCollectionJoinField(fieldSchema['x-collection-field']);
if (fieldSchema && record?.__collection && ['select', 'multipleSelect'].includes(collectionField.interface)) {
if (fieldSchema && record?.__collection && ['select', 'multipleSelect'].includes(collectionField?.interface)) {
const fieldName = `${record.__collection}.${fieldSchema.name}`;
schema.properties[fieldSchema.name]['x-collection-field'] = fieldName;
return <RecursionField basePath={basePath} schema={schema} onlyRenderProperties />;