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

32 lines
707 B
Plaintext
Raw Normal View History

import { ajax } from "discourse/lib/ajax";
2020-05-12 14:41:26 -04:00
import DiscourseRoute from "discourse/routes/discourse";
2020-05-12 14:41:26 -04:00
export default DiscourseRoute.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),
2019-09-11 11:38:31 -04:00
group
};
})
2019-09-11 11:30:39 -04:00
.catch(() => {
this.transitionTo("group.members", group);
});
},
setupController(controller, model) {
controller.setProperties(model);
},
actions: {
refreshModel() {
this.refresh();
return false;
}
}
});