default user
This commit is contained in:
parent
201b26059c
commit
d27609de40
|
@ -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,
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue