Delete machine pings on unpair
This commit is contained in:
parent
8330b95de1
commit
09332c37db
2 changed files with 4 additions and 1 deletions
|
|
@ -37,7 +37,8 @@ function removeDeviceConfig (deviceId) {
|
|||
|
||||
function unpair (deviceId) {
|
||||
const sql = 'delete from devices where device_id=$1'
|
||||
return db.none(sql, [deviceId])
|
||||
const deleteMachinePings = 'delete from machine_pings where device_id=$1'
|
||||
return Promise.all([db.none(sql, [deviceId]), db.none(deleteMachinePings, [deviceId])])
|
||||
.then(() => removeDeviceConfig(deviceId))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue