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