fix: association field detection to be based on type (#6692)

This commit is contained in:
Katherine 2025-04-17 11:44:38 +08:00 committed by GitHub
parent 83be9b1013
commit 0961c4399d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,12 +31,7 @@ export const useFieldModeOptions = (props?) => {
if (!collectionField || !collectionField?.interface) {
return;
}
if (
!['o2o', 'oho', 'obo', 'o2m', 'linkTo', 'm2o', 'm2m', 'updatedBy', 'createdBy', 'mbm', 'attachmentURL'].includes(
collectionField.interface,
)
)
return;
if (!['hasOne', 'hasMany', 'belongsTo', 'belongsToMany', 'belongsToArray'].includes(collectionField.type)) return;
const collection = getCollection(collectionField.target);
if (collection?.template === 'file') {
return isReadPretty