2021-09-09 08:07:12 +02:00
|
|
|
import { A } from "@ember/array";
|
2024-11-22 17:11:51 +01:00
|
|
|
import { service } from "@ember/service";
|
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
import CustomWizardLogs from "../models/custom-wizard-logs";
|
2021-09-09 08:07:12 +02:00
|
|
|
|
|
|
|
export default DiscourseRoute.extend({
|
2023-09-14 15:42:12 +02:00
|
|
|
router: service(),
|
|
|
|
|
2021-09-09 08:07:12 +02:00
|
|
|
model(params) {
|
|
|
|
return CustomWizardLogs.list(params.wizardId);
|
|
|
|
},
|
|
|
|
|
2022-12-27 17:28:58 +01:00
|
|
|
afterModel(model) {
|
|
|
|
if (model === null) {
|
2023-09-14 15:42:12 +02:00
|
|
|
return this.router.transitionTo("adminWizardsLogs");
|
2022-12-27 17:28:58 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-09-09 08:07:12 +02:00
|
|
|
setupController(controller, model) {
|
|
|
|
controller.setProperties({
|
|
|
|
wizard: model.wizard,
|
|
|
|
logs: A(model.logs),
|
|
|
|
total: model.total,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|