random route stuff
This commit is contained in:
parent
d27ff64a74
commit
9a63772401
8 changed files with 143 additions and 124 deletions
|
|
@ -43,8 +43,8 @@ function authorizeCaDownload (caToken) {
|
|||
function isPaired (deviceId) {
|
||||
const sql = 'select device_id from devices where device_id=$1 and paired=TRUE'
|
||||
|
||||
return db.one(sql, [deviceId])
|
||||
.then(() => true)
|
||||
return db.oneOrNone(sql, [deviceId])
|
||||
.then(row => row && row.device_id === deviceId)
|
||||
}
|
||||
|
||||
module.exports = {pair, authorizeCaDownload, isPaired}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue