Chore: refactor to use new schema changing queries
This commit is contained in:
parent
304f792484
commit
e6059be8d2
44 changed files with 185 additions and 171 deletions
|
|
@ -69,7 +69,7 @@ function logAction (rec, tx) {
|
|||
|
||||
const sql = pgp.helpers.insert(action, null, 'cash_in_actions')
|
||||
|
||||
return db.none(sql)
|
||||
return db.$none(sql)
|
||||
.then(_.constant(rec))
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ function logActionById (action, _rec, txId) {
|
|||
const rec = _.assign(_rec, { action, tx_id: txId })
|
||||
const sql = pgp.helpers.insert(rec, null, 'cash_in_actions')
|
||||
|
||||
return db.none(sql)
|
||||
return db.$none(sql)
|
||||
}
|
||||
|
||||
function checkForBlacklisted (tx) {
|
||||
|
|
@ -165,7 +165,7 @@ function monitorPending (settings) {
|
|||
.catch(logger.error)
|
||||
}
|
||||
|
||||
return db.any(sql, [PENDING_INTERVAL, MAX_PENDING])
|
||||
return db.$any(sql, [PENDING_INTERVAL, MAX_PENDING])
|
||||
.then(rows => pEachSeries(rows, row => processPending(row)))
|
||||
.catch(logger.error)
|
||||
}
|
||||
|
|
@ -182,7 +182,7 @@ function cancel (txId) {
|
|||
return pgp.helpers.update(updateRec, null, 'cash_in_txs') +
|
||||
pgp.as.format(' where id=$1', [txId])
|
||||
})
|
||||
.then(sql => db.result(sql, false))
|
||||
.then(sql => db.$result(sql, false))
|
||||
.then(res => {
|
||||
if (res.rowCount !== 1) throw new Error('No such tx-id')
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue