2019-05-30 07:04:34 +02:00
|
|
|
import CustomWizardApi from '../models/custom-wizard-api';
|
2020-03-21 18:30:11 +01:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2019-05-30 07:04:34 +02:00
|
|
|
|
2020-03-21 18:30:11 +01:00
|
|
|
export default DiscourseRoute.extend({
|
2019-06-02 12:54:31 +02:00
|
|
|
queryParams: {
|
|
|
|
refresh_list: {
|
|
|
|
refreshModel: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-05-30 07:04:34 +02:00
|
|
|
model(params) {
|
2019-06-02 12:54:31 +02:00
|
|
|
if (params.name === 'new') {
|
|
|
|
return CustomWizardApi.create({ isNew: true });
|
2019-05-30 07:04:34 +02:00
|
|
|
} else {
|
2019-06-02 12:54:31 +02:00
|
|
|
return CustomWizardApi.find(params.name);
|
2019-05-30 07:04:34 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model){
|
2019-05-31 09:54:11 +02:00
|
|
|
controller.set("api", model);
|
2019-05-30 07:04:34 +02:00
|
|
|
}
|
|
|
|
});
|