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

@ -52,7 +52,7 @@ function fetchPhoneTx (phone) {
const values = [phone, false, TRANSACTION_EXPIRATION]
return db.any(sql, values)
return db.$any(sql, values)
.then(_.map(toCashOutTx))
.then(txs => {
const seenTxs = _.some(it => it.status !== 'notSeen', txs)
@ -76,7 +76,7 @@ function fetchPhoneTx (phone) {
function fetchStatusTx (txId, status) {
const sql = 'select * from cash_out_txs where id=$1'
return db.oneOrNone(sql, [txId])
return db.$oneOrNone(sql, [txId])
.then(toCashOutTx)
.then(tx => {
if (!tx) throw httpError('No transaction', 404)
@ -86,7 +86,7 @@ function fetchStatusTx (txId, status) {
}
function updateDeviceConfigVersion (versionId) {
return db.none('update devices set user_config_id=$1', [versionId])
return db.$none('update devices set user_config_id=$1', [versionId])
}
module.exports = {