This commit is contained in:
Josh Harvey 2016-10-26 21:30:58 +03:00
parent 06ff037189
commit 745eb225df
4 changed files with 13 additions and 8 deletions

View file

@ -121,6 +121,7 @@ function poll (req, res) {
}
function trade (req, res, next) {
console.log('DEBUG24')
const tx = req.body
tx.cryptoAtoms = new BigNumber(tx.cryptoAtoms)
@ -218,11 +219,7 @@ function updatePhone (req, res) {
function fetchPhoneTx (req, res) {
return plugins.fetchPhoneTx(req.query.phone)
.then(r => res.json(r))
.catch(err => {
logger.error(err)
res.sendStatus(500)
})
.then(r => res.json(r))
}
function registerRedeem (req, res) {
@ -259,6 +256,8 @@ function isUniqueViolation (err) {
}
function cacheAction (req, res, next) {
console.log('DEBUG22: %s', req.path)
const sql = `insert into idempotents (request_id, device_id, body, status, pending)
values ($1, $2, $3, $4, $5)`
@ -302,7 +301,7 @@ function cacheAndRespond (req, res, _body, _status) {
const body = _body || {}
return updateCachedAction(req, body, status)
.then(() => res.status(status).json(body))
// .then(() => res.status(status).json(body))
}
function httpError (msg, code) {