1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

Cleansing input rows against the table schema.

This commit is contained in:
mike12345567 2021-05-28 11:59:04 +01:00
parent a367acfd74
commit 6c2f0f5917

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