WIP -- fix back compat with raqia
This commit is contained in:
parent
ca161fb9f2
commit
190efd4d70
2 changed files with 5 additions and 3 deletions
|
|
@ -489,12 +489,14 @@ function insertDispense (client, session, tx, cartridges, transactionId, cb) {
|
|||
|
||||
exports.addIncomingPhone = function addIncomingPhone (session, tx, notified, cb) {
|
||||
var sql = 'UPDATE transactions SET phone=$1, notified=$2 ' +
|
||||
'WHERE incoming=$3 AND device_fingerprint=$4 AND session_id=$5 AND phone IS NULL'
|
||||
'WHERE incoming=$3 AND device_fingerprint=$4 AND session_id=$5 ' +
|
||||
'AND stage=$6 AND authority=$7 AND phone IS NULL'
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
connect(function (cerr, client, done) {
|
||||
if (cerr) return reject(cerr)
|
||||
var values = [tx.phone, notified, true, session.fingerprint, tx.sessionId]
|
||||
var values = [tx.phone, notified, true, session.fingerprint,
|
||||
tx.sessionId, 'initial_request', 'pending']
|
||||
query(client, sql, values, function (err, results) {
|
||||
done(err)
|
||||
if (err) return reject(err)
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ function phoneCode (req, res) {
|
|||
function updatePhone (req, res) {
|
||||
const notified = req.query.notified === 'true'
|
||||
return plugins.updatePhone(session(req), req.body, notified)
|
||||
.then(res => res.json(res))
|
||||
.then(r => res.json(r))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.sendStatus(500)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue