mirror of
https://github.com/openstf/stf
synced 2025-10-05 19:42:01 +02:00
Remove device owner if device is not present.
This commit is contained in:
parent
1945ae26a7
commit
52416ebde4
1 changed files with 9 additions and 0 deletions
|
@ -121,6 +121,9 @@ module.exports = function(options) {
|
||||||
list.forEach(function(device) {
|
list.forEach(function(device) {
|
||||||
datautil.applyData(device)
|
datautil.applyData(device)
|
||||||
datautil.applyOwner(device, req.user)
|
datautil.applyOwner(device, req.user)
|
||||||
|
if (!device.present) {
|
||||||
|
device.owner = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
res.json({
|
res.json({
|
||||||
success: true
|
success: true
|
||||||
|
@ -144,6 +147,9 @@ module.exports = function(options) {
|
||||||
list.forEach(function(device) {
|
list.forEach(function(device) {
|
||||||
datautil.applyData(device)
|
datautil.applyData(device)
|
||||||
datautil.applyOwner(device, req.user)
|
datautil.applyOwner(device, req.user)
|
||||||
|
if (!device.present) {
|
||||||
|
device.owner = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
res.json({
|
res.json({
|
||||||
success: true
|
success: true
|
||||||
|
@ -165,6 +171,9 @@ module.exports = function(options) {
|
||||||
if (device) {
|
if (device) {
|
||||||
datautil.applyData(device)
|
datautil.applyData(device)
|
||||||
datautil.applyOwner(device, req.user)
|
datautil.applyOwner(device, req.user)
|
||||||
|
if (!device.present) {
|
||||||
|
device.owner = null
|
||||||
|
}
|
||||||
res.json({
|
res.json({
|
||||||
success: true
|
success: true
|
||||||
, device: device
|
, device: device
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue