fix: load field when source collection not found

This commit is contained in:
Chareice 2023-12-06 09:45:32 +08:00
parent 16ad19b18d
commit 95bec2278f
No known key found for this signature in database

View File

@ -298,8 +298,7 @@ export class Collection<
this.db.logger.warn(
`source collection "${sourceCollectionName}" not found for field "${name}" at collection "${this.name}"`,
);
}
} else {
const sourceField = sourceCollection.fields.get(sourceFieldName);
if (!sourceField) {
@ -310,6 +309,7 @@ export class Collection<
options = { ...lodash.omit(sourceField.options, ['name', 'primaryKey']), ...options };
}
}
}
this.emit('field.beforeAdd', name, options, { collection: this });