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