summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-12-13 13:51:30 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-12-13 13:54:36 +0100
commit7841be243e5f28828cea95500b554d7f5cc039eb (patch)
treef9c4dcc6f5015323f65025dcfe693a8e52ca0f3f /lib/api
parent9a3c53fd4e79b73e51c8aadeb8a996db65088811 (diff)
downloadgitlab-ce-7841be243e5f28828cea95500b554d7f5cc039eb.tar.gz
API: Ability to get group's project in simple representationapi-simple-group-project
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/groups.rb5
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