mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 08:41:44 +08:00
25 lines
549 B
JavaScript
25 lines
549 B
JavaScript
export default Discourse.Route.extend({
|
|
|
|
model: function(params) {
|
|
return Discourse.Group.find(params.name);
|
|
},
|
|
|
|
serialize: function(model) {
|
|
return { name: model.get('name').toLowerCase() };
|
|
},
|
|
|
|
afterModel: function(model) {
|
|
var self = this;
|
|
return Discourse.Group.findGroupCounts(model.get('name')).then(function (counts) {
|
|
self.set('counts', counts);
|
|
});
|
|
},
|
|
|
|
setupController: function(controller, model) {
|
|
controller.setProperties({
|
|
model: model,
|
|
counts: this.get('counts')
|
|
});
|
|
}
|
|
});
|