Support both presence constraint variants (#12617)
This commit is contained in:
parent
3697ff3efc
commit
3f11597251
|
@ -164,7 +164,8 @@
|
|||
// Required constraint
|
||||
if (
|
||||
field === dataSourceSchema?.table?.primaryDisplay ||
|
||||
constraints.presence?.allowEmpty === false
|
||||
constraints.presence?.allowEmpty === false ||
|
||||
constraints.presence === true
|
||||
) {
|
||||
rules.push({
|
||||
constraint: "required",
|
||||
|
|
|
@ -23,7 +23,8 @@ export const createValidatorFromConstraints = (
|
|||
// Required constraint
|
||||
if (
|
||||
field === table?.primaryDisplay ||
|
||||
schemaConstraints.presence?.allowEmpty === false
|
||||
schemaConstraints.presence?.allowEmpty === false ||
|
||||
schemaConstraints.presence === true
|
||||
) {
|
||||
rules.push({
|
||||
type: schemaConstraints.type == "array" ? "array" : "string",
|
||||
|
|
Loading…
Reference in New Issue