diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-01 20:27:29 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-01 20:27:29 +0000 |
commit | a87815fbc07359d83918e1ff61961af174f76fe0 (patch) | |
tree | db91cd7738b780d0753def87b31ce5b135bddd46 /app | |
parent | b3700dea0163c70fbc89d97fbcc206f0dee1aeb7 (diff) | |
parent | 8f3c8448591d9282ece108ba811083d0a662c346 (diff) | |
download | gitlab-ce-a87815fbc07359d83918e1ff61961af174f76fe0.tar.gz |
Merge branch 'fix/gb/improve-merge-request-pipelines-api' into 'master'
Improve internal API for new merge request
Closes #27866
See merge request !9304
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 | 4 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 b/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 index e7c6c063413..cd2bd883d32 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.js.es6 @@ -69,7 +69,9 @@ const PipelineStore = require('./pipelines_store'); return pipelinesService.all() .then(response => response.json()) .then((json) => { - this.store.storePipelines(json); + // depending of the endpoint the response can either bring a `pipelines` key or not. + const pipelines = json.pipelines || json; + this.store.storePipelines(pipelines); this.isLoading = false; }) .catch(() => { diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 53f30a24312..825e8e327a4 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -245,9 +245,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController format.json do define_pipelines_vars - render json: PipelineSerializer + render json: { + pipelines: PipelineSerializer .new(project: @project, user: @current_user) .represent(@pipelines) + } end end end |