Cleansing input rows against the table schema.

This commit is contained in:
mike12345567 2021-05-28 11:59:04 +01:00
parent 1ae8264276
commit 70019b9b74
1 changed files with 2 additions and 1 deletions

View File

@ -171,8 +171,9 @@ exports.inputProcessing = (user = {}, table, row) => {
const copiedTable = cloneDeep(table)
for (let [key, value] of Object.entries(clonedRow)) {
const field = table.schema[key]
// cleanse fields that aren't in the schema
if (!field) {
continue
delete clonedRow[key]
}
clonedRow[key] = exports.coerce(value, field.type)
}