implement save :)

This commit is contained in:
Sam 2013-05-24 21:04:26 +10:00
parent a8ae81df4b
commit a1520f0dee
1 changed files with 15 additions and 0 deletions

View File

@ -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);
});
}
});