renamed end to stop globally

fixed getting favourites for admins
This commit is contained in:
barisusakli
2015-03-31 23:40:58 -04:00
parent 27bab3330a
commit 878e548296
26 changed files with 160 additions and 166 deletions

View File

@@ -18,8 +18,8 @@ var categoriesController = {},
categoriesController.recent = function(req, res, next) {
var uid = req.user ? req.user.uid : 0;
var end = (parseInt(meta.config.topicsPerList, 10) || 20) - 1;
topics.getTopicsFromSet('topics:recent', uid, 0, end, function(err, data) {
var stop = (parseInt(meta.config.topicsPerList, 10) || 20) - 1;
topics.getTopicsFromSet('topics:recent', uid, 0, stop, function(err, data) {
if (err) {
return next(err);
}
@@ -72,8 +72,8 @@ categoriesController.popular = function(req, res, next) {
categoriesController.unread = function(req, res, next) {
var uid = req.user ? req.user.uid : 0;
var end = (parseInt(meta.config.topicsPerList, 10) || 20) - 1;
topics.getUnreadTopics(uid, 0, end, function (err, data) {
var stop = (parseInt(meta.config.topicsPerList, 10) || 20) - 1;
topics.getUnreadTopics(uid, 0, stop, function (err, data) {
if (err) {
return next(err);
}