1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/routes/admin-wizard-submissions.js.es6
Angus McLeod a09376e645 various
2017-10-30 14:24:51 +08:00

27 Zeilen
641 B
JavaScript

import CustomWizard from '../models/custom-wizard';
export default Discourse.Route.extend({
model(params) {
return Ember.RSVP.hash({
submissions: CustomWizard.submissions(params.wizard_id),
wizard: this.modelFor('admin-wizards-submissions').findBy('id', params.wizard_id)
});
},
setupController(controller, model) {
let fields = ['user_id', 'completed'];
model.wizard.steps.forEach((s) => {
if (s.fields) {
s.fields.forEach((f) => {
fields.push(f.id);
});
};
});
controller.setProperties({
submissions: model.submissions,
fields
});
}
});