This commit is contained in:
Josh Harvey 2017-03-22 00:51:51 +02:00
parent 340ad2b518
commit b7a93b89f5
5 changed files with 159 additions and 77 deletions

View file

@ -72,15 +72,12 @@ function fetchPhoneTx (phone) {
}
function fetchStatusTx (txId, status) {
console.log('DEBUG444')
const sql = 'select * from cash_out_txs where id=$1'
return db.oneOrNone(sql, [txId])
.then(toObj)
.then(tx => {
console.log('DEBUG445')
if (!tx) throw httpError('No transaction', 404)
console.log('DEBUG446')
if (tx.status === status) throw httpError('Not Modified', 304)
return tx
})