Merge pull request #8464 from dserodio/group-api-description

Add description attribute to group API (GET and POST)
This commit is contained in:
Dmitriy Zaporozhets 2015-01-18 10:35:25 -08:00
commit 0533ae7eec
4 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@ v 7.8.0
- Replace highlight.js with rouge-fork rugments (Stefan Tatschner)
-
-
-
- Expose description in groups API
-
-
-

View File

@ -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

View File

@ -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

View File

@ -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