From 654c348e4e75bff6098542d16a90a5b670ce73f3 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 20 Feb 2023 18:46:06 +0000 Subject: [PATCH] Generate inclusion schema when importing multiselect columns --- packages/server/src/api/controllers/table/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/table/utils.ts b/packages/server/src/api/controllers/table/utils.ts index bbccde467b..866b0a8f42 100644 --- a/packages/server/src/api/controllers/table/utils.ts +++ b/packages/server/src/api/controllers/table/utils.ts @@ -111,7 +111,8 @@ export function importToRows(data: any, table: any, user: any = {}) { for ([fieldName, schema] of Object.entries(table.schema)) { // check whether the options need to be updated for inclusion as part of the data import if ( - schema.type === FieldTypes.OPTIONS && + (schema.type === FieldTypes.OPTIONS || + schema.type === FieldTypes.ARRAY) && row[fieldName] && (!schema.constraints.inclusion || schema.constraints.inclusion.indexOf(row[fieldName]) === -1)