mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-23 22:35:25 +02:00
Remove device owner if device is not present.
This commit is contained in:
@@ -121,6 +121,9 @@ module.exports = function(options) {
|
||||
list.forEach(function(device) {
|
||||
datautil.applyData(device)
|
||||
datautil.applyOwner(device, req.user)
|
||||
if (!device.present) {
|
||||
device.owner = null
|
||||
}
|
||||
})
|
||||
res.json({
|
||||
success: true
|
||||
@@ -144,6 +147,9 @@ module.exports = function(options) {
|
||||
list.forEach(function(device) {
|
||||
datautil.applyData(device)
|
||||
datautil.applyOwner(device, req.user)
|
||||
if (!device.present) {
|
||||
device.owner = null
|
||||
}
|
||||
})
|
||||
res.json({
|
||||
success: true
|
||||
@@ -165,6 +171,9 @@ module.exports = function(options) {
|
||||
if (device) {
|
||||
datautil.applyData(device)
|
||||
datautil.applyOwner(device, req.user)
|
||||
if (!device.present) {
|
||||
device.owner = null
|
||||
}
|
||||
res.json({
|
||||
success: true
|
||||
, device: device
|
||||
|
||||
Reference in New Issue
Block a user