discourse/app/assets/javascripts/admin/routes/admin-group.js.es6
Régis Hanol e300945879 FEATURE: split group admin in 2 tabs (custom & automatic)
FIX: clear the user-selector when adding new members
2015-01-21 20:52:48 +01:00

20 lines
497 B
JavaScript

export default Discourse.Route.extend({
model: function(params) {
var groups = this.modelFor('adminGroupsType'),
group = groups.findProperty('name', params.name);
if (!group) { return this.transitionTo('adminGroups.index'); }
return group;
},
setupController: function(controller, model) {
controller.set("model", model);
// clear the user selector
controller.set("usernames", null);
// load the members of the group
model.findMembers();
}
});