diff --git a/app/assets/javascripts/admin/models/group.js b/app/assets/javascripts/admin/models/group.js index 39710ab24fe..6ce30de46d9 100644 --- a/app/assets/javascripts/admin/models/group.js +++ b/app/assets/javascripts/admin/models/group.js @@ -58,6 +58,21 @@ Discourse.Group = Discourse.Model.extend({ group.set('disableSave', false); group.set('id', r.id); }); + }, + + + save: function(){ + var group = this; + group.set('disableSave', true); + + return Discourse.ajax("/admin/groups/" + this.get('id'), {type: "PUT", data: { + group: { + name: this.get('name'), + usernames: this.get('usernames') + } + }}).then(function(r){ + group.set('disableSave', false); + }); } });