1
0
Fork 0
mirror of synced 2024-09-15 08:47:37 +12:00

Generate inclusion schema when importing multiselect columns

This commit is contained in:
Andrew Kingston 2023-02-20 18:46:06 +00:00
parent c627cb60c3
commit 654c348e4e

View file

@ -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)