refactor: move pairing.js:isPaired() to machine-loader.js:getPairedMachineName()

This commit is contained in:
siiky 2025-06-03 11:32:52 +01:00
parent 22b6b64fe4
commit 49080b0412
3 changed files with 11 additions and 13 deletions

View file

@ -81,13 +81,4 @@ function authorizeCaDownload(caToken) {
})
}
function isPaired(deviceId) {
const sql =
'select device_id, name from devices where device_id=$1 and paired=TRUE'
return db
.oneOrNone(sql, [deviceId])
.then(row => (row && row.device_id === deviceId ? row.name : false))
}
module.exports = { pair, unpair, authorizeCaDownload, isPaired }
module.exports = { pair, unpair, authorizeCaDownload }