From 84100ab0cd6d79aa69e4ff39586af92f3eff3b09 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Mon, 30 May 2022 12:05:25 +0100 Subject: [PATCH] Convert array string to array type --- packages/server/src/api/controllers/row/utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/api/controllers/row/utils.js b/packages/server/src/api/controllers/row/utils.js index 9bea800d63..5da7ca331e 100644 --- a/packages/server/src/api/controllers/row/utils.js +++ b/packages/server/src/api/controllers/row/utils.js @@ -64,6 +64,9 @@ exports.validate = async ({ tableId, row, table }) => { // Validate.js doesn't seem to handle array if (type === FieldTypes.ARRAY && row[fieldName]) { if (row[fieldName].length) { + if (!Array.isArray(row[fieldName])) { + row[fieldName] = row[fieldName].split(",") + } row[fieldName].map(val => { if ( !constraints.inclusion.includes(val) &&