Expose serialized pipelines API for merge requests

This commit is contained in:
Grzegorz Bizon 2017-01-27 13:44:05 +01:00
parent 1ad6b3696b
commit 3cb37c0349
1 changed files with 10 additions and 1 deletions

View File

@ -214,7 +214,16 @@ class Projects::MergeRequestsController < Projects::ApplicationController
render 'show'
end
format.json { render json: { html: view_to_html_string('projects/merge_requests/show/_pipelines') } }
format.json do
render json: {
html: view_to_html_string('projects/merge_requests/show/_pipelines'),
pipelines: PipelineSerializer
.new(project: @project, user: @current_user)
.with_pagination(request, response)
.represent(@pipelines)
}
end
end
end