service failure delete route

pull/127/head v0.80.48
Hunter Long 2019-02-12 11:38:36 -08:00
parent d85c6e4280
commit d5e346fa0e
2 changed files with 12 additions and 2 deletions

View File

@ -68,3 +68,10 @@ script:
after_success:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make travis-build; fi
webhooks:
urls:
- $GITTER
on_success: change
on_failure: always
on_start: never

View File

@ -326,9 +326,12 @@ func servicesDeleteFailuresHandler(w http.ResponseWriter, r *http.Request) {
}
vars := mux.Vars(r)
service := core.SelectService(utils.ToInt(vars["id"]))
if service == nil {
sendErrorJson(errors.New("service not found"), w, r)
return
}
service.DeleteFailures()
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(service.AllFailures())
sendJsonAction(service, "delete_failures", w, r)
}
func apiServiceFailuresHandler(w http.ResponseWriter, r *http.Request) {