This commit is contained in:
Josh Harvey 2016-05-27 16:53:09 +03:00
parent 7055104218
commit 98e863d31d
4 changed files with 109 additions and 199 deletions

View file

@ -269,11 +269,12 @@ function waitForDispense (req, res) {
function dispense (req, res) {
const tx = req.body.tx
const body = {dispense: true}
return plugins.requestDispense(session(req), tx)
.then(() => cacheResponse(req, body))
.then(() => res.json(body))
return plugins.requestDispense(tx)
.then(r => {
return cacheResponse(req, r)
.then(() => res.json(r))
})
.catch(err => {
logger.error(err)
res.sendStatus(500)