diff --git a/CHANGELOG b/CHANGELOG index 387d42a7aca5a1b28a07edf22946d35ce5584eb3..f2f6e0ce8bb8cf82a4cfe5c040667f652b8248f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,7 +4,7 @@ v 7.8.0 - Replace highlight.js with rouge-fork rugments (Stefan Tatschner) - - - - + - Expose description in groups API - - - diff --git a/doc/api/groups.md b/doc/api/groups.md index 8aae4f6b1bb36d6740849673ce1cf1a963639257..e6893d7177400f0a2fa7468efa09431c0539faaa 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -14,7 +14,8 @@ GET /groups "id": 1, "name": "Foobar Group", "path": "foo-bar", - "owner_id": 18 + "owner_id": 18, + "description": "An interesting group" } ] ``` @@ -45,6 +46,7 @@ Parameters: - `name` (required) - The name of the group - `path` (required) - The path of the group +- `description` (optional) - The group's description ## Transfer project to group diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 2fea151aeb3be247a94c3f15d129f85c98f0aec9..ac166ed4fbafb81b90b2bc2056914607597307ae 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 + expose :id, :name, :path, :owner_id, :description end class GroupDetail < Group diff --git a/lib/api/groups.rb b/lib/api/groups.rb index bda60b3b7d53aa3e49841e4ae4d297800da8d6ad..730dfad52c89c81bc065a498e1ec7b2bc824f3fd 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -47,7 +47,7 @@ module API authenticated_as_admin! required_attributes! [:name, :path] - attrs = attributes_for_keys [:name, :path] + attrs = attributes_for_keys [:name, :path, :description] @group = Group.new(attrs) @group.owner = current_user