mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:36:05 +00: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