fix: exclude 'attachmentURL' from associated form item filter (#6809)

This commit is contained in:
Zeke Zhang 2025-04-30 07:42:18 +08:00 committed by GitHub
parent 5c2bd3c496
commit db88e8301f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -599,9 +599,9 @@ const associationFieldToMenu = (
export const useFilterAssociatedFormItemInitializerFields = () => {
const { name, fields } = useCollection_deprecated();
const { getCollectionFields } = useCollectionManager_deprecated();
const interfaces = ['o2o', 'oho', 'obo', 'm2o', 'm2m'];
const excludedInterfaces = ['attachmentURL'];
return fields
?.filter((field) => field.target && field.uiSchema && interfaces.includes(field.interface))
?.filter((field) => field.target && field.uiSchema && !excludedInterfaces.includes(field.interface))
.map((field) => associationFieldToMenu(field, field.name, name, getCollectionFields, []))
.filter(Boolean);
};