discourse/app/assets/javascripts/wizard/addon/routes/wizard-step.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
466 B
JavaScript
Raw Normal View History

import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({
model(params) {
const allSteps = this.modelFor("wizard").steps;
const step = allSteps.findBy("id", params.step_id);
return step || allSteps[0];
},
setupController(controller, step) {
const wizard = this.modelFor("wizard");
this.controllerFor("wizard").set("currentStepId", step.id);
controller.setProperties({ step, wizard });
},
});