diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-08-04 20:06:02 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-08-05 11:55:45 +0200 |
commit | abfa9b41dbd4c8d107ff6d8e37579bde112143b5 (patch) | |
tree | cf72eac36c227af484c93d368b7cdd70e1d789d6 | |
parent | 0ac87af6ce25abf7e12a63a9cec1a2d10c841196 (diff) | |
download | gitlab-ci-abfa9b41dbd4c8d107ff6d8e37579bde112143b5.tar.gz |
Fix project API listing returning empty list when first projects are not added to CI
The CI prefers to receive the projects added to CI first
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | lib/api/projects.rb | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -7,6 +7,7 @@ v7.14.0 (unreleased) - Use avatars received from GitLab - Refactor GitLab API usage to use either access_token or private_token depending on what was specified during login - Allow to use access_token for API requests + - Fix project API listing returning empty list when first projects are not added to CI - Added support for CI skipped status diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 0311c56..58539d3 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -34,7 +34,7 @@ module API # GET /projects get do gitlab_projects = Project.from_gitlab( - current_user, :authorized, { page: params[:page], per_page: params[:per_page] } + current_user, :authorized, { page: params[:page], per_page: params[:per_page], ci_enabled_first: true } ) ids = gitlab_projects.map { |project| project.id } @@ -48,7 +48,7 @@ module API # GET /projects/owned get "owned" do gitlab_projects = Project.from_gitlab( - current_user, :owned, { page: params[:page], per_page: params[:per_page] } + current_user, :owned, { page: params[:page], per_page: params[:per_page], ci_enabled_first: true } ) ids = gitlab_projects.map { |project| project.id } |