0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-12-02 05:21:10 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizards.js.es6
angusmcleod 49538d554d Linting
2021-11-17 20:48:11 +08:00

27 Zeilen
694 B
JavaScript

import DiscourseRoute from "discourse/routes/discourse";
import { ajax } from "discourse/lib/ajax";
export default DiscourseRoute.extend({
model() {
return ajax("/admin/wizards");
},
setupController(controller, model) {
controller.set("api_section", model.api_section);
if (model.active_notice_count) {
controller.set("activeNoticeCount", model.active_notice_count);
}
if (model.featured_notices) {
controller.set("featuredNotices", model.featured_notices);
}
controller.subscribe();
},
afterModel(model, transition) {
if (transition.targetName === "adminWizards.index") {
this.transitionTo("adminWizardsWizard");
}
},
});