FIX: "Action Logs" button on user admin page (#25300)

The `transitionToRoute` API was removed in Ember 5 in favour of the route service
This commit is contained in:
David Taylor 2024-01-17 13:49:59 +00:00 committed by GitHub
parent f2e669a008
commit ec1905cf6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 6 deletions

View File

@ -1,4 +1,3 @@
import { getOwner } from "@ember/application";
import { action } from "@ember/object";
import Service, { inject as service } from "@ember/service";
import { htmlSafe } from "@ember/template";
@ -14,13 +13,11 @@ import AdminUser from "admin/models/admin-user";
export default class AdminToolsService extends Service {
@service dialog;
@service modal;
@service router;
showActionLogs(target, filters) {
const controller = getOwner(target).lookup(
"controller:adminLogs.staffActionLogs"
);
target.transitionToRoute("adminLogs.staffActionLogs").then(() => {
controller.changeFilters(filters);
this.router.transitionTo("adminLogs.staffActionLogs", {
queryParams: { filters },
});
}