diff --git a/lib/cashbox-batches.js b/lib/cashbox-batches.js index 134cec42..4da64701 100644 --- a/lib/cashbox-batches.js +++ b/lib/cashbox-batches.js @@ -19,15 +19,7 @@ function createCashboxBatch (rec) { function getBatches () { const sql = `SELECT cb.id, cb.device_id, cb.created, cb.operation_type, cb.bill_count_override, cb.performed_by, json_agg(b.*) AS bills FROM cashbox_batches cb LEFT JOIN bills b ON cb.id=b.cashbox_batch_id GROUP BY cb.id` - return db.any(sql).then(res => _.map(it => ({ - id: it.id, - deviceId: it.device_id, - created: it.created, - operationType: it.operation_type, - billCountOverride: it.bill_count_override, - performedBy: it.performed_by, - bills: it.bills - }), res)) + return db.any(sql).then(res => _.map(it => _.mapKeys(ite => _.camelCase(ite), it), res)) } function editBatchById (id, performedBy) {