Fix schema require checks
This commit is contained in:
parent
616b1bf012
commit
cd1a7699b2
|
@ -84,7 +84,7 @@ export function validate(
|
||||||
"Column names can't contain special characters"
|
"Column names can't contain special characters"
|
||||||
} else if (
|
} else if (
|
||||||
columnData == null &&
|
columnData == null &&
|
||||||
!schema[columnName].constraints?.presence
|
!helpers.schema.isRequired(constraints)
|
||||||
) {
|
) {
|
||||||
results.schemaValidation[columnName] = true
|
results.schemaValidation[columnName] = true
|
||||||
} else if (
|
} else if (
|
||||||
|
@ -94,6 +94,11 @@ export function validate(
|
||||||
isAutoColumn
|
isAutoColumn
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
|
} else if (
|
||||||
|
[FieldType.STRING].includes(columnType) &&
|
||||||
|
helpers.schema.isRequired(constraints)
|
||||||
|
) {
|
||||||
|
results.schemaValidation[columnName] = false
|
||||||
} else if (columnType === FieldType.NUMBER && isNaN(Number(columnData))) {
|
} else if (columnType === FieldType.NUMBER && isNaN(Number(columnData))) {
|
||||||
// If provided must be a valid number
|
// If provided must be a valid number
|
||||||
results.schemaValidation[columnName] = false
|
results.schemaValidation[columnName] = false
|
||||||
|
|
Loading…
Reference in New Issue