Commit e0fdb4262aa8b5351fe55044b942f4ce595be25c
Exists in
spb-stable
and in
2 other branches
Merge pull request #6823 from milgner/api_expose_project_archived_status
Expose archive status of projects in API
Showing
2 changed files
with
7 additions
and
3 deletions
Show diff stats
doc/api/projects.md
... | ... | @@ -43,7 +43,8 @@ GET /projects |
43 | 43 | "owner_id": 1, |
44 | 44 | "path": "diaspora", |
45 | 45 | "updated_at": "2013-09-30T13: 46: 02Z" |
46 | - } | |
46 | + }, | |
47 | + "archived": false | |
47 | 48 | }, |
48 | 49 | { |
49 | 50 | "id": 6, |
... | ... | @@ -78,7 +79,8 @@ GET /projects |
78 | 79 | "owner_id": 1, |
79 | 80 | "path": "brightbox", |
80 | 81 | "updated_at": "2013-09-30T13:46:02Z" |
81 | - } | |
82 | + }, | |
83 | + "archived": false | |
82 | 84 | } |
83 | 85 | ] |
84 | 86 | ``` |
... | ... | @@ -157,7 +159,8 @@ Parameters: |
157 | 159 | "access_level": 50, |
158 | 160 | "notification_level": 3 |
159 | 161 | } |
160 | - } | |
162 | + }, | |
163 | + "archived": false | |
161 | 164 | } |
162 | 165 | ``` |
163 | 166 | ... | ... |
lib/api/entities.rb
... | ... | @@ -43,6 +43,7 @@ module API |
43 | 43 | class Project < Grape::Entity |
44 | 44 | expose :id, :description, :default_branch |
45 | 45 | expose :public?, as: :public |
46 | + expose :archived?, as: :archived | |
46 | 47 | expose :visibility_level, :ssh_url_to_repo, :http_url_to_repo, :web_url |
47 | 48 | expose :owner, using: Entities::UserBasic, unless: ->(project, options) { project.group } |
48 | 49 | expose :name, :name_with_namespace | ... | ... |