mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
25 lines
604 B
JavaScript
25 lines
604 B
JavaScript
import Group from 'discourse/models/group';
|
|
|
|
export default Discourse.Route.extend({
|
|
|
|
model(params) {
|
|
if (params.name === 'new') {
|
|
return Group.create({ automatic: false, visible: true });
|
|
}
|
|
|
|
const group = this.modelFor('adminGroupsType')
|
|
.findProperty('name', params.name);
|
|
|
|
if (!group) { return this.transitionTo('adminGroups.index'); }
|
|
|
|
return group;
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.set("model", model);
|
|
controller.set("model.usernames", null);
|
|
controller.set("savingStatus", "");
|
|
model.findMembers();
|
|
}
|
|
|
|
});
|