mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
added helpers.redirect
This commit is contained in:
@@ -200,8 +200,7 @@ categoriesController.get = function(req, res, next) {
|
||||
var topicCount = parseInt(results.categoryData.topic_count, 10);
|
||||
|
||||
if (topicIndex < 0 || topicIndex > Math.max(topicCount - 1, 0)) {
|
||||
var url = '/category/' + cid + '/' + req.params.slug + (topicIndex > topicCount ? '/' + topicCount : '');
|
||||
return res.locals.isAPI ? res.status(302).json(url) : res.redirect(url);
|
||||
return helpers.redirect(res, '/category/' + cid + '/' + req.params.slug + (topicIndex > topicCount ? '/' + topicCount : ''));
|
||||
}
|
||||
|
||||
userPrivileges = results.privileges;
|
||||
|
||||
Reference in New Issue
Block a user