From a1debf5cf029edc550d7d46eff7ef4ab1b51a2b2 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 10 Apr 2017 11:30:06 +0100 Subject: Retry and cancel endpoints send 204 json response. Request is made with type json --- app/controllers/projects/pipelines_controller.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/pipelines_controller.rb') 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 -- cgit v1.2.1