0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-10 04:12:53 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizard-submissions.js.es6
Angus McLeod be81aa7f4d various
2017-11-01 12:21:14 +08:00

27 Zeilen
625 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'];
model.wizard.steps.forEach((s) => {
if (s.fields) {
s.fields.forEach((f) => {
fields.push(f.id);
});
};
});
controller.setProperties({
submissions: model.submissions,
fields
});
}
});