mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:46:00 +00:00
fix: do not automatically generate target, when target exists
This commit is contained in:
parent
ecab106c3c
commit
2a383e2142
@ -28,7 +28,9 @@ export class FieldModel extends BaseModel {
|
||||
if (['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(data.type)) {
|
||||
if (!data.name) {
|
||||
data.name = generateFieldName();
|
||||
data.target = generateCollectionName();
|
||||
if (!data.target) {
|
||||
data.target = generateCollectionName();
|
||||
}
|
||||
}
|
||||
if (!data.target) {
|
||||
data.target = ['hasOne', 'belongsTo'].includes(data.type) ? Utils.pluralize(data.name) : data.name;
|
||||
|
Loading…
Reference in New Issue
Block a user