default user

This commit is contained in:
Martin McKeaveney 2021-04-15 23:14:10 +01:00
parent 201b26059c
commit d27609de40
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ exports.save = async function(ctx) {
// this returns the table and row incase they have been updated // this returns the table and row incase they have been updated
const dbTable = await db.get(inputs.tableId) const dbTable = await db.get(inputs.tableId)
let { table, row } = inputProcessing(ctx.user || {}, dbTable, inputs) let { table, row } = inputProcessing(ctx.user, dbTable, inputs)
const validateResult = await validate({ const validateResult = await validate({
row, row,
table, table,

View File

@ -143,7 +143,7 @@ exports.coerce = (row, type) => {
* @param {object} table the table which the row is being saved to. * @param {object} table the table which the row is being saved to.
* @returns {object} the row which has been prepared to be written to the DB. * @returns {object} the row which has been prepared to be written to the DB.
*/ */
exports.inputProcessing = (user, table, row) => { exports.inputProcessing = (user = {}, table, row) => {
let clonedRow = cloneDeep(row) let clonedRow = cloneDeep(row)
// need to copy the table so it can be differenced on way out // need to copy the table so it can be differenced on way out
const copiedTable = cloneDeep(table) const copiedTable = cloneDeep(table)