summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/groups.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 8d0664386b4..7572104fc16 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -65,7 +65,7 @@ module API
end
class Group < Grape::Entity
- expose :id, :name, :path, :owner_id, :description
+ expose :id, :name, :path, :description
end
class GroupDetail < Group
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 384a28e41f5..a92abd4b690 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -33,9 +33,9 @@ module API
attrs = attributes_for_keys [:name, :path, :description]
@group = Group.new(attrs)
- @group.owner = current_user
if @group.save
+ @group.add_owner(current_user)
present @group, with: Entities::Group
else
render_api_error!("Failed to save group #{@group.errors.messages}", 400)