Create support_logs (db & api)

This commit is contained in:
goga-m 2017-10-27 17:36:40 +03:00 committed by Josh Harvey
parent b7d6f3f419
commit 62d606cc80
8 changed files with 279 additions and 58 deletions

View file

@ -46,12 +46,12 @@ function pair (token, deviceId, machineModel) {
.then(r => {
if (r.expired) return false
const insertSql = `insert into devices (device_id) values ($1)
const insertSql = `insert into devices (device_id, name) values ($1, $2)
on conflict (device_id)
do update set paired=TRUE, display=TRUE`
return configureNewDevice(deviceId, r.name, machineModel)
.then(() => db.none(insertSql, [deviceId]))
.then(() => db.none(insertSql, [deviceId, r.name]))
.then(() => true)
})
.catch(err => {