mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-04 05:08:42 +08:00
fix: remove required parameter from the field options
This commit is contained in:
parent
a3107721c2
commit
a7c9461cc0
@ -95,14 +95,11 @@ export function getDataTypeKey(type: any): string {
|
||||
* @param context
|
||||
*/
|
||||
export function buildField(options: FieldOptions, context: Fields.FieldContext) {
|
||||
let { type, required } = options;
|
||||
let { type } = options;
|
||||
if (type instanceof ABSTRACT) {
|
||||
options = {...type.options, ...options};
|
||||
}
|
||||
type = getDataTypeKey(type);
|
||||
if (type !== 'VIRTUAL' && required) {
|
||||
options.allowNull = false;
|
||||
}
|
||||
const Field = getField(type);
|
||||
return new Field({type, ...options}, context);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user