Delete app activities when deleting device

This commit is contained in:
Jonas L 2019-04-15 00:00:00 +00:00
parent aa141c33a2
commit 67bb7d4b9c

View file

@ -49,6 +49,14 @@ export async function removeDevice ({ database, familyId, deviceId, websocket }:
transaction transaction
}) })
await database.appActivity.destroy({
where: {
familyId,
deviceId
},
transaction
})
// remove as current device // remove as current device
await database.user.update({ await database.user.update({
currentDevice: '' currentDevice: ''