got rid of all the res.locals.isAPI checks in all controller methods. now 1000% cleaner :shipit:

This commit is contained in:
psychobunny
2014-03-09 20:05:14 -04:00
parent faf3de7e27
commit a99be8e7be
7 changed files with 74 additions and 283 deletions

View File

@@ -16,11 +16,7 @@ categoriesController.recent = function(req, res, next) {
return next(err);
}
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('recent', data);
}
res.render('recent', data);
});
};
@@ -36,11 +32,7 @@ categoriesController.popular = function(req, res, next) {
return next(err);
}
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('popular', data);
}
res.render('popular', data);
});
};
@@ -52,11 +44,7 @@ categoriesController.unread = function(req, res, next) {
return next(err);
}
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('unread', data);
}
res.render('unread', data);
});
};
@@ -68,11 +56,7 @@ categoriesController.unreadTotal = function(req, res, next) {
return next(err);
}
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('unread', data);
}
res.render('unread', data);
});
};
@@ -182,11 +166,7 @@ categoriesController.get = function(req, res, next) {
});
}
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('category', data);
}
res.render('category', data);
});
};