mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
This change is discussed here: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821 Prior to this change we were not booting correctly with DISCOURSE_NO_CONSTANTS
26 lines
574 B
JavaScript
26 lines
574 B
JavaScript
import Group from 'discourse/models/group';
|
|
|
|
export default Discourse.Route.extend({
|
|
|
|
model: function(params) {
|
|
return Group.find(params.name);
|
|
},
|
|
|
|
serialize: function(model) {
|
|
return { name: model.get('name').toLowerCase() };
|
|
},
|
|
|
|
afterModel: function(model) {
|
|
var self = this;
|
|
return Group.findGroupCounts(model.get('name')).then(function (counts) {
|
|
self.set('counts', counts);
|
|
});
|
|
},
|
|
|
|
setupController: function(controller, model) {
|
|
controller.setProperties({
|
|
model: model,
|
|
counts: this.get('counts')
|
|
});
|
|
}
|
|
});
|