new middleware to add slug to topic and category

This commit is contained in:
barisusakli
2014-03-15 15:29:56 -04:00
parent 1eafc6ba3d
commit 37e8856861
4 changed files with 27 additions and 23 deletions

View File

@@ -18,16 +18,6 @@ topicsController.get = function(req, res, next) {
uid = req.user ? req.user.uid : 0,
privileges;
if (!req.params.slug && !res.locals.isAPI) {
topics.getTopicField(tid, 'slug', function(err, slug) {
if (err) {
return next(err);
}
res.redirect('/topic/' + slug);
});
return;
}
async.waterfall([
function(next) {
threadTools.privileges(tid, ((req.user) ? req.user.uid || 0 : 0), function(err, userPrivileges) {