Chore: refactor to use new schema changing queries

This commit is contained in:
csrapr 2021-03-01 15:55:29 +00:00 committed by Josh Harvey
parent 304f792484
commit e6059be8d2
44 changed files with 185 additions and 171 deletions

View file

@ -37,7 +37,7 @@ function batch () {
from cash_out_txs
order by created desc limit $1`
return Promise.all([db.any(cashInSql, [cashInTx.PENDING_INTERVAL, NUM_RESULTS]), db.any(cashOutSql, [NUM_RESULTS, REDEEMABLE_AGE])])
return Promise.all([db.$any(cashInSql, [cashInTx.PENDING_INTERVAL, NUM_RESULTS]), db.$any(cashOutSql, [NUM_RESULTS, REDEEMABLE_AGE])])
.then(packager)
}
@ -57,8 +57,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)