diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-13 15:51:30 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-13 15:54:36 +0300 |
commit | 7841be243e5f28828cea95500b554d7f5cc039eb (patch) | |
tree | f9c4dcc6f5015323f65025dcfe693a8e52ca0f3f /lib | |
parent | 9a3c53fd4e79b73e51c8aadeb8a996db65088811 (diff) |
API: Ability to get group's project in simple representation
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/groups.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 105d3ee342e..9b9d3df7435 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -125,13 +125,16 @@ module API default: 'created_at', desc: 'Return projects ordered by field' optional :sort, type: String, values: %w[asc desc], default: 'desc', desc: 'Return projects sorted in ascending and descending order' + optional :simple, type: Boolean, default: false, + desc: 'Return only the ID, URL, name, and path of each project' use :pagination end get ":id/projects" do group = find_group!(params[:id]) projects = GroupProjectsFinder.new(group).execute(current_user) projects = filter_projects(projects) - present paginate(projects), with: Entities::Project, user: current_user + entity = params[:simple] ? Entities::BasicProjectDetails : Entities::Project + present paginate(projects), with: entity, user: current_user end desc 'Transfer a project to the group namespace. Available only for admin.' do |