0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizards-submissions-show.js.es6
2022-09-23 15:52:05 +02:00

24 Zeilen
690 B
JavaScript

import { A } from "@ember/array";
import EmberObject from "@ember/object";
import CustomWizardAdmin from "../models/custom-wizard-admin";
import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({
model(params) {
return CustomWizardAdmin.submissions(params.wizardId);
},
setupController(controller, model) {
const fields = model.fields.map((f) => {
const fieldsObject = EmberObject.create(f);
fieldsObject.enabled = true;
return fieldsObject;
});
controller.setProperties({
wizard: model.wizard,
fields: A(fields),
submissions: A(model.submissions),
total: model.total,
});
},
});