|
|
@ -20,6 +20,7 @@ import { |
|
|
|
import View from './View'; |
|
|
|
import View from './View'; |
|
|
|
import { NcError } from '../meta/helpers/catchError'; |
|
|
|
import { NcError } from '../meta/helpers/catchError'; |
|
|
|
import Audit from './Audit'; |
|
|
|
import Audit from './Audit'; |
|
|
|
|
|
|
|
import { sanitize } from '../db/sql-data-mapper/lib/sql/helpers/sanitize'; |
|
|
|
|
|
|
|
|
|
|
|
export default class Model implements TableType { |
|
|
|
export default class Model implements TableType { |
|
|
|
copy_enabled: boolean; |
|
|
|
copy_enabled: boolean; |
|
|
@ -405,11 +406,7 @@ export default class Model implements TableType { |
|
|
|
if (isVirtualCol(col)) continue; |
|
|
|
if (isVirtualCol(col)) continue; |
|
|
|
const val = data?.[col.column_name] ?? data?.[col.title]; |
|
|
|
const val = data?.[col.column_name] ?? data?.[col.title]; |
|
|
|
if (val !== undefined) { |
|
|
|
if (val !== undefined) { |
|
|
|
insertObj[ |
|
|
|
insertObj[sanitize(col.column_name)] = val; |
|
|
|
col.column_name.replace(/([^\\]|^)(\?+)/g, (_, m1, m2) => { |
|
|
|
|
|
|
|
return `${m1}${m2.split('?').join('\\?')}`; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
] = val; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return insertObj; |
|
|
|
return insertObj; |
|
|
|