diff options
author | Rémy Coutable <remy@rymai.me> | 2017-11-07 10:59:38 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-11-07 10:59:38 +0000 |
commit | 31e3ef93e53802bb99b342a7b403972493ed63cc (patch) | |
tree | 150d4328b00f71c2f28f7a58003b73e3d0548b5c /lib/api | |
parent | 2ec5ae21b8ab16bea83c4b00df5bf17be8ad34c6 (diff) | |
parent | 1f773a8ef5a1f76166d0455c6a5e473278885c17 (diff) | |
download | gitlab-ce-31e3ef93e53802bb99b342a7b403972493ed63cc.tar.gz |
Merge branch 'feature/custom-attributes-on-projects-and-groups' into 'master'
Support custom attributes on groups and projects
See merge request gitlab-org/gitlab-ce!14593
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/groups.rb | 9 | ||||
-rw-r--r-- | lib/api/helpers.rb | 1 | ||||
-rw-r--r-- | lib/api/projects.rb | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index e817dcbbc4b..340a7cecf09 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -37,6 +37,8 @@ module API end resource :groups do + include CustomAttributesEndpoints + desc 'Get a groups list' do success Entities::Group end @@ -51,7 +53,12 @@ module API use :pagination end get do - find_params = { all_available: params[:all_available], owned: params[:owned] } + find_params = { + all_available: params[:all_available], + owned: params[:owned], + custom_attributes: params[:custom_attributes] + } + groups = GroupsFinder.new(current_user, find_params).execute groups = groups.search(params[:search]) if params[:search].present? groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present? diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 1c12166e434..5f9b94cc89c 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -328,6 +328,7 @@ module API finder_params[:archived] = params[:archived] finder_params[:search] = params[:search] if params[:search] finder_params[:user] = params.delete(:user) if params[:user] + finder_params[:custom_attributes] = params[:custom_attributes] if params[:custom_attributes] finder_params end diff --git a/lib/api/projects.rb b/lib/api/projects.rb index aab7a6c3f93..4cd7e714aa2 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -119,6 +119,8 @@ module API end resource :projects do + include CustomAttributesEndpoints + desc 'Get a list of visible projects for authenticated user' do success Entities::BasicProjectDetails end |