0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-23 01:40:29 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizards-logs-show.js.es6

27 Zeilen
628 B
Text

import CustomWizardLogs from "../models/custom-wizard-logs";
import DiscourseRoute from "discourse/routes/discourse";
import { A } from "@ember/array";
2023-09-14 15:47:52 +02:00
import { inject as service } from "@ember/service";
export default DiscourseRoute.extend({
2023-09-14 15:42:12 +02:00
router: service(),
model(params) {
return CustomWizardLogs.list(params.wizardId);
},
afterModel(model) {
if (model === null) {
2023-09-14 15:42:12 +02:00
return this.router.transitionTo("adminWizardsLogs");
}
},
setupController(controller, model) {
controller.setProperties({
wizard: model.wizard,
logs: A(model.logs),
total: model.total,
});
},
});