Retry and cancel endpoints send 204 json response. Request is made with type json
This commit is contained in:
parent
3a2b60f7a0
commit
a1debf5cf0
2 changed files with 19 additions and 3 deletions
|
@ -40,6 +40,6 @@ export default class PipelinesService {
|
|||
* @return {Promise}
|
||||
*/
|
||||
postAction(endpoint) {
|
||||
return Vue.http.post(endpoint, {}, { emulateJSON: true });
|
||||
return Vue.http.post(`${endpoint}.json`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue