diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-04-10 13:30:06 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-05-05 10:32:13 +0300 |
commit | a1debf5cf029edc550d7d46eff7ef4ab1b51a2b2 (patch) | |
tree | 04dbad14775ead86b65ec8cd76bde4c0cb463c77 /app/controllers/projects/pipelines_controller.rb | |
parent | 3a2b60f7a0109cdb84e8727a2625318a746e84dc (diff) |
Retry and cancel endpoints send 204 json response. Request is made with type json
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 454b8ee17af..6d77b9c38fa 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -92,13 +92,29 @@ class Projects::PipelinesController < Projects::ApplicationController def retry pipeline.retry_failed(current_user) - redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + respond_to do |format| + format.html do + redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + end + + format.json do + render status: 204 + end + end end def cancel pipeline.cancel_running - redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + respond_to do |format| + format.html do + redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) + end + + format.json do + render status: 204 + end + end end def charts |