groups: upon group-creation, creator is automatically assigned as leader

and only member. Remove sending up leader & members from the client,
should all be handled on the server
This commit is contained in:
Tyler Renelle
2014-01-05 14:45:01 -07:00
parent 8c319b6079
commit e474278ab3
3 changed files with 417 additions and 370 deletions

View File

@@ -201,7 +201,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
$scope.type = 'guild';
$scope.text = 'Guild';
var newGroup = function(){
return new Groups.Group({type:'guild', privacy:'private', leader: User.user._id, members: [User.user._id]});
return new Groups.Group({type:'guild', privacy:'private'});
}
$scope.newGroup = newGroup()
$scope.create = function(group){
@@ -272,7 +272,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
$scope.type = 'party';
$scope.text = 'Party';
$scope.group = $rootScope.party = Groups.party();
$scope.newGroup = new Groups.Group({type:'party', leader: User.user._id, members: [User.user._id]});
$scope.newGroup = new Groups.Group({type:'party'});
$scope.create = function(group){
group.$save(function(newGroup){
$scope.group = newGroup;