DEV: Resolve transitionTo deprecation (#268)
This commit is contained in:
parent
e067df0b43
commit
a6341627d0
|
@ -16,6 +16,7 @@ export default class PluginsExplorerController extends Controller {
|
|||
@service("router") router;
|
||||
@service dialog;
|
||||
@service appEvents;
|
||||
@service router;
|
||||
|
||||
@tracked sortByProperty = "last_run_at";
|
||||
@tracked sortDescending = true;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class GroupReportsIndexRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
|
||||
model() {
|
||||
const group = this.modelFor("group");
|
||||
return ajax(`/g/${group.name}/reports`)
|
||||
|
@ -11,7 +14,7 @@ export default class GroupReportsIndexRoute extends DiscourseRoute {
|
|||
group,
|
||||
};
|
||||
})
|
||||
.catch(() => this.transitionTo("group.members", group));
|
||||
.catch(() => this.router.transitionTo("group.members", group));
|
||||
}
|
||||
|
||||
afterModel(model) {
|
||||
|
@ -19,7 +22,7 @@ export default class GroupReportsIndexRoute extends DiscourseRoute {
|
|||
!model.group.get("is_group_user") &&
|
||||
!(this.currentUser && this.currentUser.admin)
|
||||
) {
|
||||
this.transitionTo("group.members", model.group);
|
||||
this.router.transitionTo("group.members", model.group);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class GroupReportsShowRoute extends DiscourseRoute {
|
||||
@service router;
|
||||
|
||||
model(params) {
|
||||
const group = this.modelFor("group");
|
||||
return ajax(`/g/${group.name}/reports/${params.query_id}`)
|
||||
|
@ -24,7 +27,7 @@ export default class GroupReportsShowRoute extends DiscourseRoute {
|
|||
};
|
||||
})
|
||||
.catch(() => {
|
||||
this.transitionTo("group.members", group);
|
||||
this.router.transitionTo("group.members", group);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue