David Taylor b3d1707b65
DEV: Refactor Wizard routes, controllers and templates (#24725)
Extracted from https://github.com/discourse/discourse/pull/23678

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-12-06 12:07:07 +00:00

18 lines
425 B
JavaScript

import { inject as service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
export default class WizardStepRoute extends DiscourseRoute {
@service router;
model(params) {
const wizard = this.modelFor("wizard");
const step = wizard.findStep(params.step_id);
if (!step) {
this.router.transitionTo("wizard.step", wizard.start);
}
return { wizard, step };
}
}