1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Fix eslint errors

This commit is contained in:
Vishal Banthia 2016-02-03 17:22:05 +09:00
parent a875d85c46
commit b60cb6ef6a
7 changed files with 49 additions and 35 deletions

View file

@ -43,10 +43,11 @@ function getUserDevices(req, res) {
list.forEach(function(device) {
datautil.normalize(device, req.user)
var responseDevice = device
if (fields) {
device = _.pick(device, fields.split(','))
responseDevice = _.pick(device, fields.split(','))
}
deviceList.push(device)
deviceList.push(responseDevice)
})
res.json({
@ -84,13 +85,14 @@ function getUserDeviceBySerial(req, res) {
})
}
if(fields) {
device = _.pick(device, fields.split(','))
var responseDevice = device
if (fields) {
responseDevice = _.pick(device, fields.split(','))
}
res.json({
success: true
, device: device
, device: responseDevice
})
})
.catch(function(err) {
@ -158,9 +160,9 @@ function addUserDevice(req, res) {
)
, timeout
, wireutil.toDeviceRequirements({
'serial': {
'value': serial
, 'match': 'exact'
serial: {
value: serial
, match: 'exact'
}
})
)
@ -193,7 +195,6 @@ function deleteUserDeviceBySerial(req, res) {
success: false
, description: 'You cannot release this device. Not owned by you'
})
}
// Timer will be called if no JoinGroupMessage is received till 5 seconds
@ -226,9 +227,9 @@ function deleteUserDeviceBySerial(req, res) {
, wireutil.envelope(
new wire.UngroupMessage(
wireutil.toDeviceRequirements({
'serial': {
'value': serial
, 'match': 'exact'
serial: {
value: serial
, match: 'exact'
}
})
)
@ -314,7 +315,6 @@ function remoteDisconnectUserDeviceBySerial(req, res) {
dbapi.loadDevice(serial)
.then(function(device) {
if (!device) {
return res.status(404).json({
success: false