Make Projects::Settings:CiCdController#reset_cache a json endpoint

This commit is contained in:
Matija Čupić 2018-03-01 18:05:42 +01:00
parent daa0c9293b
commit 7fc88fd76a
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 6 additions and 4 deletions

View File

@ -13,12 +13,14 @@ module Projects
def reset_cache
if ResetProjectCacheService.new(@project, current_user).execute
flash[:notice] = _("Project cache successfully reset.")
respond_to do |format|
format.json { head :ok }
end
else
flash[:error] = _("Unable to reset project cache.")
respond_to do |format|
format.json { head :bad_request }
end
end
redirect_to project_pipelines_path(@project)
end
private