mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Convert admin section controllers to ES6 modules
This commit is contained in:
committed by
Robin Ward
parent
2358d13d49
commit
e242368266
26
app/assets/javascripts/admin/controllers/admin-groups.js.es6
Normal file
26
app/assets/javascripts/admin/controllers/admin-groups.js.es6
Normal file
@@ -0,0 +1,26 @@
|
||||
export default 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);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user