chore: undo $ prepend on queries

This commit is contained in:
Taranto 2021-07-22 11:06:39 +01:00 committed by Josh Harvey
parent f3f2bb01b0
commit ba4117173e
50 changed files with 215 additions and 227 deletions

View file

@ -93,8 +93,8 @@ function batch (
ORDER BY created DESC limit $4 offset $5`
return Promise.all([
db.$any(cashInSql, [cashInTx.PENDING_INTERVAL, from, until, limit, offset, id, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status]),
db.$any(cashOutSql, [REDEEMABLE_AGE, from, until, limit, offset, id, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status])
db.any(cashInSql, [cashInTx.PENDING_INTERVAL, from, until, limit, offset, id, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status]),
db.any(cashOutSql, [REDEEMABLE_AGE, from, until, limit, offset, id, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status])
])
.then(packager)
}
@ -136,8 +136,8 @@ function getCustomerTransactionsBatch (ids) {
WHERE c.id IN ($1^)
ORDER BY created DESC limit $2`
return Promise.all([
db.$any(cashInSql, [_.map(pgp.as.text, ids).join(','), cashInTx.PENDING_INTERVAL, NUM_RESULTS]),
db.$any(cashOutSql, [_.map(pgp.as.text, ids).join(','), NUM_RESULTS, REDEEMABLE_AGE])
db.any(cashInSql, [_.map(pgp.as.text, ids).join(','), cashInTx.PENDING_INTERVAL, NUM_RESULTS]),
db.any(cashOutSql, [_.map(pgp.as.text, ids).join(','), NUM_RESULTS, REDEEMABLE_AGE])
])
.then(packager).then(transactions => {
const transactionMap = _.groupBy('customerId', transactions)
@ -180,8 +180,8 @@ function single (txId) {
WHERE id=$1`
return Promise.all([
db.$oneOrNone(cashInSql, [cashInTx.PENDING_INTERVAL, txId]),
db.$oneOrNone(cashOutSql, [txId, REDEEMABLE_AGE])
db.oneOrNone(cashInSql, [cashInTx.PENDING_INTERVAL, txId]),
db.oneOrNone(cashOutSql, [txId, REDEEMABLE_AGE])
])
.then(packager)
.then(_.head)