discourse-data-explorer/assets/javascripts/discourse/routes/group-reports-show.js.es6

31 lines
658 B
JavaScript

import { ajax } from "discourse/lib/ajax";
export default Discourse.Route.extend({
controllerName: "group-reports-show",
model(params) {
const group = this.modelFor("group");
return ajax(`/g/${group.name}/reports/${params.query_id}`)
.then(response => {
return {
model: Object.assign({ params: {} }, response.query),
group: group
};
})
.catch(() => {
this.transitionTo("group.members", group);
});
},
setupController(controller, model) {
controller.setProperties(model);
},
actions: {
refreshModel() {
this.refresh();
return false;
}
}
});