Fix issue saving a doc with a multi-options datatype that was not defined
This commit is contained in:
parent
d5983d5603
commit
1f1786c2b3
|
@ -68,7 +68,11 @@ exports.validate = async ({ appId, tableId, row, table }) => {
|
||||||
let res
|
let res
|
||||||
|
|
||||||
// Validate.js doesn't seem to handle array
|
// Validate.js doesn't seem to handle array
|
||||||
if (table.schema[fieldName].type === FieldTypes.ARRAY) {
|
if (
|
||||||
|
table.schema[fieldName].type === FieldTypes.ARRAY &&
|
||||||
|
row[fieldName] &&
|
||||||
|
row[fieldName].length
|
||||||
|
) {
|
||||||
row[fieldName].map(val => {
|
row[fieldName].map(val => {
|
||||||
if (!constraints.inclusion.includes(val)) {
|
if (!constraints.inclusion.includes(val)) {
|
||||||
errors[fieldName] = "Field not in list"
|
errors[fieldName] = "Field not in list"
|
||||||
|
|
Loading…
Reference in New Issue