1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

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

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)
}