diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-29 18:02:08 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-07 15:38:03 +0200 |
commit | 3152477114ed95d2ca5b5a27487c4f392f7486fa (patch) | |
tree | 76f12a95dbb8b25a4a8e37d1e3ee17880329b3fc /lib/api/pipelines.rb | |
parent | a83c5ff48f74c718bd4d0f9b5746502e2ebaff27 (diff) | |
download | gitlab-ce-3152477114ed95d2ca5b5a27487c4f392f7486fa.tar.gz |
Use PipelinesFinder in Pipelines API
Diffstat (limited to 'lib/api/pipelines.rb')
-rw-r--r-- | lib/api/pipelines.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index 2aae75c471d..2a0c8e1f2c0 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -13,11 +13,14 @@ module API params do optional :page, type: Integer, desc: 'Page number of the current request' optional :per_page, type: Integer, desc: 'Number of items per page' + optional :scope, type: String, values: ['running', 'branches', 'tags'], + desc: 'Either running, branches, or tags' end get ':id/pipelines' do authorize! :read_pipeline, user_project - present paginate(user_project.pipelines), with: Entities::Pipeline + pipelines = PipelinesFinder.new(user_project).execute(scope: params[:scope]) + present paginate(pipelines), with: Entities::Pipeline end desc 'Gets a specific pipeline for the project' do |