2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/app/assets/javascripts/discourse/routes/group.js.es6

27 lines
574 B
Text
Raw Normal View History

import Group from 'discourse/models/group';
2014-07-28 13:39:20 -04:00
export default Discourse.Route.extend({
2014-02-06 16:14:32 -05:00
model: function(params) {
return Group.find(params.name);
2014-02-06 13:06:19 -05:00
},
2014-02-18 16:43:02 -05:00
serialize: function(model) {
return { name: model.get('name').toLowerCase() };
},
afterModel: function(model) {
var self = this;
return Group.findGroupCounts(model.get('name')).then(function (counts) {
2014-02-18 16:17:04 -05:00
self.set('counts', counts);
});
},
setupController: function(controller, model) {
controller.setProperties({
model: model,
2014-02-18 16:17:04 -05:00
counts: this.get('counts')
});
}
});