1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00

Merge pull request #1184 from Budibase/bug/auto-id-increment

Auto increment ID fix
This commit is contained in:
Michael Drury 2021-02-24 18:10:01 +00:00 committed by GitHub
commit 80b25138cf

View file

@ -136,6 +136,8 @@ exports.coerce = (row, type) => {
*/
exports.inputProcessing = (user, table, row) => {
let clonedRow = cloneDeep(row)
// need to copy the table so it can be differenced on way out
const copiedTable = cloneDeep(table)
for (let [key, value] of Object.entries(clonedRow)) {
const field = table.schema[key]
if (!field) {
@ -144,7 +146,7 @@ exports.inputProcessing = (user, table, row) => {
clonedRow[key] = exports.coerce(value, field.type)
}
// handle auto columns - this returns an object like {table, row}
return processAutoColumn(user, table, clonedRow)
return processAutoColumn(user, copiedTable, clonedRow)
}
/**