Fixed lint issues

This commit is contained in:
Loren West 2014-12-25 22:45:58 -08:00
parent 5d2fc21fab
commit 34ba1fedc5
1 changed files with 3 additions and 3 deletions

View File

@ -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 });