1
0
Fork 0

add router service to controllers to avoid deprecation

Dieser Commit ist enthalten in:
merefield 2023-09-14 14:58:34 +01:00
Ursprung 33a320021f
Commit 742239b023
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -7,8 +7,11 @@ import { selectKitContent } from "../lib/wizard";
import { underscore } from "@ember/string";
import Controller from "@ember/controller";
import I18n from "I18n";
import { inject as service } from '@ember/service';
export default Controller.extend({
router: service(),
queryParams: ["refresh_list"],
loadingSubscriptions: false,
notAuthorized: not("api.authorized"),
@ -248,7 +251,7 @@ export default Controller.extend({
.catch(popupAjaxError)
.then((result) => {
if (result.success) {
this.transitionToRoute("adminWizardsApis").then(() => {
this.router.transitionToRoute("adminWizardsApis").then(() => {
this.send("refreshModel");
});
}

Datei anzeigen

@ -1,7 +1,9 @@
import Controller from "@ember/controller";
import getUrl from "discourse-common/lib/get-url";
import { inject as service } from '@ember/service';
export default Controller.extend({
router: service(),
wizard: null,
step: null,
@ -15,12 +17,12 @@ export default Controller.extend({
const wizardId = this.get("wizard.id");
window.location.href = getUrl(`/w/${wizardId}/steps/${nextStepId}`);
} else {
this.transitionToRoute("customWizardStep", nextStepId);
this.router.transitionToRoute("customWizardStep", nextStepId);
}
},
goBack() {
this.transitionToRoute("customWizardStep", this.get("step.previous"));
this.router.transitionToRoute("customWizardStep", this.get("step.previous"));
},
showMessage(message) {