Commit a1debf5c authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Grzegorz Bizon

Retry and cancel endpoints send 204 json response. Request is made with type json

parent 3a2b60f7
...@@ -40,6 +40,6 @@ export default class PipelinesService { ...@@ -40,6 +40,6 @@ export default class PipelinesService {
* @return {Promise} * @return {Promise}
*/ */
postAction(endpoint) { postAction(endpoint) {
return Vue.http.post(endpoint, {}, { emulateJSON: true }); return Vue.http.post(`${endpoint}.json`);
} }
} }
...@@ -92,15 +92,31 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -92,15 +92,31 @@ class Projects::PipelinesController < Projects::ApplicationController
def retry def retry
pipeline.retry_failed(current_user) pipeline.retry_failed(current_user)
respond_to do |format|
format.html do
redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project)
end end
format.json do
render status: 204
end
end
end
def cancel def cancel
pipeline.cancel_running pipeline.cancel_running
respond_to do |format|
format.html do
redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project) redirect_back_or_default default: namespace_project_pipelines_path(project.namespace, project)
end end
format.json do
render status: 204
end
end
end
def charts def charts
@charts = {} @charts = {}
@charts[:week] = Ci::Charts::WeekChart.new(project) @charts[:week] = Ci::Charts::WeekChart.new(project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment