mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
remove /1 from url if it goes to first post of topic
This commit is contained in:
@@ -44,7 +44,8 @@ module.exports = function (Posts) {
|
||||
const postIndex = utils.isNumber(indices[index]) ? parseInt(indices[index], 10) + 1 : null;
|
||||
|
||||
if (slug && postIndex) {
|
||||
return `/topic/${slug}/${postIndex}`;
|
||||
const index = postIndex === 1 ? '' : `/${postIndex}`;
|
||||
return `/topic/${slug}${index}`;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user