diff --git a/packages/server/src/api/controllers/table/utils.ts b/packages/server/src/api/controllers/table/utils.ts index e57da7ae2d..5681095df7 100644 --- a/packages/server/src/api/controllers/table/utils.ts +++ b/packages/server/src/api/controllers/table/utils.ts @@ -129,20 +129,18 @@ export function importToRows( // the real schema of the table passed in, not the clone used for // incrementing auto IDs for (const [fieldName, schema] of Object.entries(originalTable.schema)) { - const rowVal = Array.isArray(row[fieldName]) ? row[fieldName] : [row[fieldName]] + const rowVal = Array.isArray(row[fieldName]) + ? row[fieldName] + : [row[fieldName]] if ( (schema.type === FieldTypes.OPTIONS || - schema.type === FieldTypes.ARRAY) && + schema.type === FieldTypes.ARRAY) && row[fieldName] ) { - - let merged = [ - ...schema.constraints!.inclusion!, - ...rowVal - ] - - let superSet = new Set(merged); - schema.constraints!.inclusion = Array.from(superSet); + let merged = [...schema.constraints!.inclusion!, ...rowVal] + + let superSet = new Set(merged) + schema.constraints!.inclusion = Array.from(superSet) schema.constraints!.inclusion.sort() }