31 lines
651 B
JavaScript
31 lines
651 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
|
|
};
|
|
})
|
|
.catch(() => {
|
|
this.transitionTo("group.members", group);
|
|
});
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.setProperties(model);
|
|
},
|
|
|
|
actions: {
|
|
refreshModel() {
|
|
this.refresh();
|
|
return false;
|
|
}
|
|
}
|
|
});
|