mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 18:35:28 +08:00
29 lines
646 B
JavaScript
29 lines
646 B
JavaScript
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);
|
|
controller.set("savingStatus", '');
|
|
model.findMembers();
|
|
}
|
|
|
|
});
|