1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/routes/admin-wizards-apis.js.es6
Angus McLeod f331f80cbb Update wizard api CRUD
- New api metadata model
- New api id system
- Minor UI updates
2019-06-02 20:54:31 +10:00

31 Zeilen
626 B
JavaScript

import CustomWizardApi from '../models/custom-wizard-api';
export default Discourse.Route.extend({
model() {
return CustomWizardApi.list();
},
afterModel(model) {
const apiParams = this.paramsFor('admin-wizards-api');
if (model.length) {
if (!apiParams.name) {
this.transitionTo('adminWizardsApi', model[0].name.dasherize());
} else {
return;
}
} else {
this.transitionTo('adminWizardsApi', 'new');
}
},
setupController(controller, model){
controller.set("model", model);
},
actions: {
refreshModel() {
this.refresh();
}
}
});