Lots of development

This commit is contained in:
Josh Harvey 2017-03-31 16:45:14 +03:00
parent 5cbec6bd23
commit 3a244f691e
19 changed files with 594 additions and 837 deletions

View file

@ -11,14 +11,7 @@ const ALPHA_BASE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
const bsAlpha = baseX(ALPHA_BASE)
function unpair (deviceId) {
const sql = 'update devices set paired=FALSE where device_id=$1'
return db.none(sql, [deviceId])
}
function repair (deviceId) {
const sql = 'update devices set paired=TRUE where device_id=$1'
const sql = 'delete from devices where device_id=$1'
return db.none(sql, [deviceId])
}
@ -39,4 +32,4 @@ function totem (hostname, name) {
})
}
module.exports = {totem, unpair, repair}
module.exports = {totem, unpair}