fix: remove console log and rename function

This commit is contained in:
José Oliveira 2021-03-25 15:16:04 +00:00 committed by Josh Harvey
parent 20703d0271
commit b5c2114cbf

View file

@ -1,6 +1,6 @@
const db = require('./db')
function createCashBoxBatch (rec) {
function createCashboxBatch (rec) {
const sql = 'INSERT INTO cashbox_batches (device_id, created) VALUES ($1, now()) RETURNING *'
const sql2 = `
UPDATE bills SET cashbox_batch_id=$1
@ -11,9 +11,8 @@ function createCashBoxBatch (rec) {
`
return db.oneOrNone(sql, [rec.deviceId])
.then(res => {
console.log(res)
return db.oneOrNone(sql2, [res.id, res.device_id])
})
}
module.exports = { createCashBoxBatch }
module.exports = { createCashboxBatch }