|
|
@ -441,11 +441,14 @@ export default class Model implements TableType { |
|
|
|
const insertObj = {}; |
|
|
|
const insertObj = {}; |
|
|
|
for (const col of await this.getColumns()) { |
|
|
|
for (const col of await this.getColumns()) { |
|
|
|
if (isVirtualCol(col)) continue; |
|
|
|
if (isVirtualCol(col)) continue; |
|
|
|
const val = |
|
|
|
let val = |
|
|
|
data?.[col.column_name] !== undefined |
|
|
|
data?.[col.column_name] !== undefined |
|
|
|
? data?.[col.column_name] |
|
|
|
? data?.[col.column_name] |
|
|
|
: data?.[col.title]; |
|
|
|
: data?.[col.title]; |
|
|
|
if (val !== undefined) { |
|
|
|
if (val !== undefined) { |
|
|
|
|
|
|
|
if (col.uidt === UITypes.Attachment && typeof val !== 'string') { |
|
|
|
|
|
|
|
val = JSON.stringify(val); |
|
|
|
|
|
|
|
} |
|
|
|
insertObj[sanitize(col.column_name)] = val; |
|
|
|
insertObj[sanitize(col.column_name)] = val; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|