mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
moved category redirect up
This commit is contained in:
@@ -165,24 +165,21 @@ categoriesController.get = function(req, res, next) {
|
||||
});
|
||||
},
|
||||
function(payload, next) {
|
||||
// If a userslug was specified, add a targetUid
|
||||
if (req.query.author) {
|
||||
user.getUidByUserslug(req.query.author, function(err, uid) {
|
||||
payload.targetUid = uid;
|
||||
next(err, payload);
|
||||
});
|
||||
} else {
|
||||
next(null, payload);
|
||||
}
|
||||
user.getUidByUserslug(req.query.author, function(err, uid) {
|
||||
payload.targetUid = uid;
|
||||
next(err, payload);
|
||||
});
|
||||
},
|
||||
function(payload, next) {
|
||||
categories.getCategoryById(payload, next);
|
||||
},
|
||||
categories.getCategoryById,
|
||||
function(categoryData, next) {
|
||||
categories.getRecentTopicReplies(categoryData.children, uid, function(err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
if (categoryData.link) {
|
||||
return res.redirect(categoryData.link);
|
||||
}
|
||||
|
||||
next(null, categoryData);
|
||||
categories.getRecentTopicReplies(categoryData.children, uid, function(err) {
|
||||
next(err, categoryData);
|
||||
});
|
||||
},
|
||||
function (categoryData, next) {
|
||||
@@ -233,10 +230,6 @@ categoriesController.get = function(req, res, next) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (data.link) {
|
||||
return res.redirect(data.link);
|
||||
}
|
||||
|
||||
data.currentPage = page;
|
||||
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user