diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-12 09:55:29 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-12-12 13:46:54 +0100 |
commit | 81a12c10fe7ba6f58ab4d1ae57861aa8899d545f (patch) | |
tree | 284106676aad83a42e30ea509471d504dd42c9cb /lib/api/groups.rb | |
parent | ff02c63cd3cfbaebb16ed770e377ae318c6be054 (diff) | |
download | gitlab-ce-81a12c10fe7ba6f58ab4d1ae57861aa8899d545f.tar.gz |
API: Fix groups filter
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r-- | lib/api/groups.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index fbf7513302b..105d3ee342e 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -1,7 +1,7 @@ module API class Groups < Grape::API include PaginationParams - + before { authenticate! } helpers do @@ -117,11 +117,20 @@ module API success Entities::Project end params do + optional :archived, type: Boolean, default: false, desc: 'Limit by archived status' + optional :visibility, type: String, values: %w[public internal private], + desc: 'Limit by visibility' + optional :search, type: String, desc: 'Return list of authorized projects matching the search criteria' + optional :order_by, type: String, values: %w[id name path created_at updated_at last_activity_at], + 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' 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 end |