discourse/app/assets/javascripts/admin/routes/admin-group.js.es6

29 lines
646 B
Plaintext
Raw Normal View History

import Group from 'discourse/models/group';
export default Discourse.Route.extend({
model: function(params) {
var groups = this.modelFor('adminGroupsType');
if (params.name === 'new') {
return Group.create({
automatic: false,
visible: true
});
}
var group = groups.findProperty('name', params.name);
if (!group) { return this.transitionTo('adminGroups.index'); }
return group;
},
setupController: function(controller, model) {
controller.set("model", model);
controller.set("model.usernames", null);
2016-04-01 05:33:25 +08:00
controller.set("savingStatus", '');
model.findMembers();
}
});