fix raqia back compat
This commit is contained in:
parent
6cfe2259cc
commit
ca161fb9f2
2 changed files with 4 additions and 4 deletions
|
|
@ -489,16 +489,16 @@ 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'
|
||||
'WHERE incoming=$3 AND device_fingerprint=$4 AND session_id=$5 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]
|
||||
query(client, sql, values, function (err) {
|
||||
query(client, sql, values, function (err, results) {
|
||||
done(err)
|
||||
if (err) return reject(err)
|
||||
resolve()
|
||||
resolve({noPhone: results.rowCount === 0})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue