Making sure certain fields aren't cleansed.
This commit is contained in:
parent
70019b9b74
commit
6416d7f197
|
@ -169,11 +169,15 @@ 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)
|
||||
const dontCleanseKeys = ["type", "_id", "_rev", "tableId"]
|
||||
for (let [key, value] of Object.entries(clonedRow)) {
|
||||
const field = table.schema[key]
|
||||
// cleanse fields that aren't in the schema
|
||||
if (!field) {
|
||||
delete clonedRow[key]
|
||||
if (copiedTable.indexOf(key) === -1) {
|
||||
delete clonedRow[key]
|
||||
}
|
||||
continue
|
||||
}
|
||||
clonedRow[key] = exports.coerce(value, field.type)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue