1
0
Fork 0
mirror of synced 2024-07-30 02:26:11 +12:00
This commit is contained in:
Dean 2023-05-04 12:12:47 +01:00
parent 98963c1505
commit f8da7a9f28

View file

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