Skip to content

Commit

Permalink
feat: allow different slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Apr 12, 2021
1 parent 60eed8d commit 4494728
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ categoryController.get = async function (req, res, next) {
return helpers.notAllowed(req, res);
}

if (!res.locals.isAPI && (!req.params.slug || categoryFields.slug !== `${cid}/${req.params.slug}`) && (categoryFields.slug && categoryFields.slug !== `${cid}/`)) {
if (!res.locals.isAPI && !req.params.slug && (categoryFields.slug && categoryFields.slug !== `${cid}/`)) {
return helpers.redirect(res, `/category/${categoryFields.slug}`, true);
}

Expand Down

0 comments on commit 4494728

Please sign in to comment.