unreadTotal route

This commit is contained in:
psychobunny
2014-02-27 16:39:34 -05:00
parent 08c0a7fa5e
commit e193d58112
2 changed files with 21 additions and 2 deletions

View File

@@ -57,6 +57,22 @@ categoriesController.unread = function(req, res, next) {
});
};
categoriesController.unreadTotal = function(req, res, next) {
var uid = req.user.uid;
topics.getTotalUnread(uid, function (err, data) {
if(err) {
return next(err);
}
if (res.locals.isAPI) {
res.json(data);
} else {
res.render('unread', data);
}
});
};
categoriesController.get = function(req, res, next) {
var cid = req.params.category_id,
page = req.query.page || 1,