Fixed lint issues
This commit is contained in:
parent
5d2fc21fab
commit
34ba1fedc5
|
@ -130,10 +130,10 @@ router.get("/robots/:robot/connections/:connection", load, function(req, res) {
|
|||
// or asynchronously if the result is a Promise.
|
||||
router.runCommand = function(req, res, my, command) {
|
||||
var result = command.apply(my, req.commandParams);
|
||||
if (typeof result.then === 'function') {
|
||||
if (typeof result.then === "function") {
|
||||
result
|
||||
.then(function(result) {return res.json({result: result})})
|
||||
.catch(function(err) {return res.status(500).json({error: err})});
|
||||
.then(function(result) {return res.json({result: result});})
|
||||
.catch(function(err) {return res.status(500).json({error: err});});
|
||||
}
|
||||
else {
|
||||
res.json({ result: result });
|
||||
|
|
Loading…
Reference in New Issue