1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

Support both presence constraint variants (#12617)

This commit is contained in:
melohagan 2023-12-19 11:02:39 +00:00 committed by GitHub
parent 3697ff3efc
commit 3f11597251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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",

View file

@ -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",