summaryrefslogtreecommitdiff
path: root/app/controllers/projects/pipelines_controller.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-04-10 11:30:06 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-05 09:32:13 +0200
commita1debf5cf029edc550d7d46eff7ef4ab1b51a2b2 (patch)
tree04dbad14775ead86b65ec8cd76bde4c0cb463c77 /app/controllers/projects/pipelines_controller.rb
parent3a2b60f7a0109cdb84e8727a2625318a746e84dc (diff)
downloadgitlab-ce-a1debf5cf029edc550d7d46eff7ef4ab1b51a2b2.tar.gz
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.rb20
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