mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: association field detection to be based on type (#6506)
This commit is contained in:
parent
ee728bd9bf
commit
186463abb2
@ -985,12 +985,11 @@ function useFormItemCollectionField() {
|
|||||||
|
|
||||||
export function useIsAssociationField() {
|
export function useIsAssociationField() {
|
||||||
const collectionField = useFormItemCollectionField();
|
const collectionField = useFormItemCollectionField();
|
||||||
const isAssociationField = ['obo', 'oho', 'o2o', 'o2m', 'm2m', 'm2o', 'updatedBy', 'createdBy', 'mbm'].includes(
|
const isAssociationField =
|
||||||
collectionField?.interface,
|
collectionField &&
|
||||||
);
|
['hasOne', 'hasMany', 'belongsTo', 'belongsToMany', 'belongsToArray'].includes(collectionField.type);
|
||||||
return isAssociationField;
|
return isAssociationField;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useIsFileField() {
|
export function useIsFileField() {
|
||||||
const cm = useCollectionManager();
|
const cm = useCollectionManager();
|
||||||
const collectionField = useFormItemCollectionField();
|
const collectionField = useFormItemCollectionField();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user