FIX: Add ember redirect for tags/:tag_id -> tag/:tag_id (#17397)

/tags/:tag_id is deprecated, but links may exist in posts.
This commit is contained in:
Daniel Waterworth 2022-07-08 14:39:43 -05:00 committed by GitHub
parent 5a26c87fa6
commit e91cc340e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -248,6 +248,9 @@ export default function () {
this.route("intersection", {
path: "intersection/:tag_id/*additional_tags",
});
// legacy route
this.route("legacyRedirect", { path: "/:tag_id" });
});
this.route(

View File

@ -0,0 +1,7 @@
import Route from "@ember/routing/route";
export default Route.extend({
beforeModel() {
this.transitionTo("tag.show", this.paramsFor("tags.legacyRedirect").tag_id);
},
});