added a check for res.locals.isAPI inside res.render, instead of doing it all over the place in code

This commit is contained in:
psychobunny
2014-03-09 19:54:16 -04:00
parent 1b3f089804
commit faf3de7e27
2 changed files with 5 additions and 5 deletions

View File

@@ -80,11 +80,7 @@ Controllers.home = function(req, res, next) {
});
}
}, function (err, data) {
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('home', data);
}
res.render('home', data);
});
};