mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 20:18:10 +08:00
FIX: Correct router service call from some admin controllers (#22757)
72edb727 updated these to point to the router service, but the method name also needed to be changed from replaceRoute -> replaceWith
This commit is contained in:
@ -59,7 +59,7 @@ export default class AdminCustomizeColorsShowController extends Controller {
|
|||||||
);
|
);
|
||||||
newColorScheme.save().then(() => {
|
newColorScheme.save().then(() => {
|
||||||
this.allColors.pushObject(newColorScheme);
|
this.allColors.pushObject(newColorScheme);
|
||||||
this.router.replaceRoute("adminCustomize.colors.show", newColorScheme);
|
this.router.replaceWith("adminCustomize.colors.show", newColorScheme);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export default class AdminCustomizeColorsShowController extends Controller {
|
|||||||
didConfirm: () => {
|
didConfirm: () => {
|
||||||
return this.model.destroy().then(() => {
|
return this.model.destroy().then(() => {
|
||||||
this.allColors.removeObject(this.model);
|
this.allColors.removeObject(this.model);
|
||||||
this.router.replaceRoute("adminCustomize.colors");
|
this.router.replaceWith("adminCustomize.colors");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ export default class AdminCustomizeColorsController extends Controller {
|
|||||||
newColorScheme.save().then(() => {
|
newColorScheme.save().then(() => {
|
||||||
this.model.pushObject(newColorScheme);
|
this.model.pushObject(newColorScheme);
|
||||||
newColorScheme.set("savingStatus", null);
|
newColorScheme.set("savingStatus", null);
|
||||||
this.router.replaceRoute("adminCustomize.colors.show", newColorScheme);
|
this.router.replaceWith("adminCustomize.colors.show", newColorScheme);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ export default class AdminCustomizeThemesEditController extends Controller {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
fieldAdded(target, name) {
|
fieldAdded(target, name) {
|
||||||
this.router.replaceRoute(
|
this.router.replaceWith(
|
||||||
this.editRouteName,
|
this.editRouteName,
|
||||||
this.get("model.id"),
|
this.get("model.id"),
|
||||||
target,
|
target,
|
||||||
@ -68,7 +68,7 @@ export default class AdminCustomizeThemesEditController extends Controller {
|
|||||||
(f) => f.edited
|
(f) => f.edited
|
||||||
);
|
);
|
||||||
|
|
||||||
this.router.replaceRoute(
|
this.router.replaceWith(
|
||||||
this.editRouteName,
|
this.editRouteName,
|
||||||
this.get("model.id"),
|
this.get("model.id"),
|
||||||
firstTarget.name,
|
firstTarget.name,
|
||||||
@ -80,6 +80,6 @@ export default class AdminCustomizeThemesEditController extends Controller {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
goBack() {
|
goBack() {
|
||||||
this.router.replaceRoute(this.showRouteName, this.model.id);
|
this.router.replaceWith(this.showRouteName, this.model.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ export default class AdminDashboardGeneralController extends Controller.extend(
|
|||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
this.exceptionController.set("thrown", e.jqXHR);
|
this.exceptionController.set("thrown", e.jqXHR);
|
||||||
this.router.replaceRoute("exception");
|
this.router.replaceWith("exception");
|
||||||
})
|
})
|
||||||
.finally(() => this.set("isLoading", false));
|
.finally(() => this.set("isLoading", false));
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ export default class AdminDashboardController extends Controller {
|
|||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
this.exceptionController.set("thrown", e.jqXHR);
|
this.exceptionController.set("thrown", e.jqXHR);
|
||||||
this.router.replaceRoute("exception");
|
this.router.replaceWith("exception");
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.set("isLoading", false);
|
this.set("isLoading", false);
|
||||||
|
Reference in New Issue
Block a user