Updated topic and category controller to not redirect on incorrect

slug if the call is made via API route.

Cold load? Anything goes.
This commit is contained in:
Julian Lam
2016-03-14 13:03:33 -04:00
parent a275aaeaf5
commit 3f998a9081
2 changed files with 2 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ topicsController.get = function(req, res, callback) {
return helpers.notAllowed(req, res);
}
if ((!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
if (!res.locals.isAPI && (!req.params.slug || results.topic.slug !== tid + '/' + req.params.slug) && (results.topic.slug && results.topic.slug !== tid + '/')) {
var url = '/topic/' + encodeURI(results.topic.slug);
if (req.params.post_index){
url += '/'+req.params.post_index;