1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Fix issue saving a doc with a multi-options datatype that was not defined

This commit is contained in:
Andrew Kingston 2021-11-05 12:37:16 +00:00
parent 9d473e9a34
commit dd73ed3e1a

View file

@ -68,7 +68,11 @@ exports.validate = async ({ appId, tableId, row, table }) => {
let res
// 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 => {
if (!constraints.inclusion.includes(val)) {
errors[fieldName] = "Field not in list"