DEV: Use category ids in URLs preferentially

This commit is contained in:
Daniel Waterworth
2019-12-02 09:28:15 +00:00
parent 9251065768
commit 374534f00e
8 changed files with 20 additions and 18 deletions
@@ -144,7 +144,7 @@ export default ComboBoxComponent.extend({
} else {
const category = Category.findById(parseInt(categoryId, 10));
const slug = Category.slugFor(category);
categoryURL = Discourse.getURL("/c/") + slug;
categoryURL = Discourse.getURL(`/c/${slug}/${categoryId}`);
}
DiscourseURL.routeTo(categoryURL);
@@ -84,7 +84,7 @@ export default ComboBoxComponent.extend(TagsMixin, {
let url = "/tags";
if (currentCategory) {
url += `/c/${Category.slugFor(currentCategory)}`;
url += `/c/${Category.slugFor(currentCategory)}/${currentCategory.id}`;
}
return Discourse.getURL(`${url}/none`);
@@ -162,7 +162,9 @@ export default ComboBoxComponent.extend(TagsMixin, {
url = "/tags";
if (this.currentCategory) {
url += `/c/${Category.slugFor(this.currentCategory)}`;
url += `/c/${Category.slugFor(this.currentCategory)}/${
this.currentCategory.id
}`;
}
url = Discourse.getURL(`${url}/${tagId.toLowerCase()}`);