support backwards compat with raqia redeem

This commit is contained in:
Josh Harvey 2016-05-11 17:56:26 +03:00
parent c4cbe0f6bb
commit 8579f2fd2d
3 changed files with 9 additions and 9 deletions

View file

@ -225,9 +225,9 @@ function pair (req, res) {
}
function phoneCode (req, res) {
console.log('DEBUG10')
var phone = req.body.phone
logger.debug('Phone code requested for: ' + phone)
return plugins.getPhoneCode(phone)
.then(code => res.json({code: code}))
.catch(err => {
@ -238,7 +238,8 @@ function phoneCode (req, res) {
}
function updatePhone (req, res) {
return plugins.updatePhone(session(req), req.body.phone)
const notified = req.query.notified === 'true'
return plugins.updatePhone(session(req), req.body, notified)
.then(code => res.json(200))
.catch(err => {
logger.error(err)
@ -267,7 +268,6 @@ function registerRedeem (req, res) {
function waitForDispense (req, res) {
return plugins.fetchTx(session(req))
.then(tx => {
console.log('%j', tx)
if (!tx) return res.send(404)
if (tx.status === req.query.status) return res.send(304)
res.json({tx: tx})