From 0961c4399df393a27fc644be1ea00b0a39b245d6 Mon Sep 17 00:00:00 2001 From: Katherine Date: Thu, 17 Apr 2025 11:44:38 +0800 Subject: [PATCH] fix: association field detection to be based on type (#6692) --- .../src/schema-component/hooks/useFieldModeOptions.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/core/client/src/schema-component/hooks/useFieldModeOptions.tsx b/packages/core/client/src/schema-component/hooks/useFieldModeOptions.tsx index e5ca454562..4e2c411042 100644 --- a/packages/core/client/src/schema-component/hooks/useFieldModeOptions.tsx +++ b/packages/core/client/src/schema-component/hooks/useFieldModeOptions.tsx @@ -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