mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
26 lines
728 B
JavaScript
26 lines
728 B
JavaScript
Discourse.AdminGroupsController = Ember.ArrayController.extend({
|
|
sortProperties: ['name'],
|
|
|
|
refreshingAutoGroups: false,
|
|
|
|
actions: {
|
|
refreshAutoGroups: function(){
|
|
var self = this,
|
|
groups = this.get('model');
|
|
|
|
self.set('refreshingAutoGroups', true);
|
|
this.transitionToRoute('adminGroups.index').then(function() {
|
|
Discourse.ajax('/admin/groups/refresh_automatic_groups', {type: 'POST'}).then(function() {
|
|
return Discourse.Group.findAll().then(function(newGroups) {
|
|
groups.clear();
|
|
groups.addObjects(newGroups);
|
|
}).finally(function() {
|
|
self.set('refreshingAutoGroups', false);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
});
|
|
|