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.
|
// or asynchronously if the result is a Promise.
|
||||||
router.runCommand = function(req, res, my, command) {
|
router.runCommand = function(req, res, my, command) {
|
||||||
var result = command.apply(my, req.commandParams);
|
var result = command.apply(my, req.commandParams);
|
||||||
if (typeof result.then === 'function') {
|
if (typeof result.then === "function") {
|
||||||
result
|
result
|
||||||
.then(function(result) {return res.json({result: result})})
|
.then(function(result) {return res.json({result: result});})
|
||||||
.catch(function(err) {return res.status(500).json({error: err})});
|
.catch(function(err) {return res.status(500).json({error: err});});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res.json({ result: result });
|
res.json({ result: result });
|
||||||
|
|
Loading…
Reference in New Issue