From 98a926cfcaa999e44eb3fe8376e6e04fa80fd88c Mon Sep 17 00:00:00 2001 From: Kacper Date: Thu, 7 Apr 2022 12:01:05 +0200 Subject: [PATCH] Do not validate if multi-select options length is 0 --- packages/server/src/api/controllers/row/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/utils.js b/packages/server/src/api/controllers/row/utils.js index 9ff6b085af..9bea800d63 100644 --- a/packages/server/src/api/controllers/row/utils.js +++ b/packages/server/src/api/controllers/row/utils.js @@ -65,7 +65,10 @@ exports.validate = async ({ tableId, row, table }) => { if (type === FieldTypes.ARRAY && row[fieldName]) { if (row[fieldName].length) { row[fieldName].map(val => { - if (!constraints.inclusion.includes(val)) { + if ( + !constraints.inclusion.includes(val) && + constraints.inclusion.length !== 0 + ) { errors[fieldName] = "Field not in list" } })