diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-30 15:35:49 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-30 15:35:49 +1100 |
commit | a7349560b2d13ea7894a462738b3a7687fdbae72 (patch) | |
tree | 6b06e74b4934e57c99d7a1684592ae97aa276394 /lib/api/projects.rb | |
parent | e5226177ac667c8ad4cc07270bbdef24031eb8a2 (diff) | |
download | gitlab-ce-a7349560b2d13ea7894a462738b3a7687fdbae72.tar.gz |
'New issue'/'New merge request' dropdowns should show only projects with issues/merge requests feature enabled19107-404-when-creating-new-milestone-or-issue-for-project-that-has-issues-disabled
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index ed5004e8d1a..d4fe5c023bf 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -58,6 +58,8 @@ module API optional :owned, type: Boolean, default: false, desc: 'Limit by owned by authenticated user' optional :starred, type: Boolean, default: false, desc: 'Limit by starred status' optional :membership, type: Boolean, default: false, desc: 'Limit by projects that the current user is a member of' + optional :with_issues_enabled, type: Boolean, default: false, desc: 'Limit by enabled issues feature' + optional :with_merge_requests_enabled, type: Boolean, default: false, desc: 'Limit by enabled merge requests feature' end params :create_params do @@ -69,11 +71,15 @@ module API options = options.reverse_merge( with: Entities::Project, current_user: current_user, - simple: params[:simple] + simple: params[:simple], + with_issues_enabled: params[:with_issues_enabled], + with_merge_requests_enabled: params[:with_merge_requests_enabled] ) projects = filter_projects(projects) projects = projects.with_statistics if options[:statistics] + projects = projects.with_issues_enabled if options[:with_issues_enabled] + projects = projects.with_merge_requests_enabled if options[:with_merge_requests_enabled] options[:with] = Entities::BasicProjectDetails if options[:simple] present paginate(projects), options |