Skip to content

Commit

Permalink
api: implement delete vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Feb 24, 2016
1 parent dc99d45 commit 8209922
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions api/v1/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,23 @@ func getVulnerability(w http.ResponseWriter, r *http.Request, p httprouter.Param
writeResponse(w, VulnerabilityEnvelope{Vulnerability: &vuln})
return writeHeader(w, http.StatusOK)
}

func patchVulnerability(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
// ez
return 0
}

func deleteVulnerability(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
// ez
return 0
err := ctx.Store.DeleteVulnerability(p.ByName("namespaceName"), p.ByName("vulnerabilityName"))
if err == cerrors.ErrNotFound {
writeResponse(w, VulnerabilityEnvelope{Error: &Error{err.Error()}})
return writeHeader(w, http.StatusNotFound)
} else if err != nil {
writeResponse(w, VulnerabilityEnvelope{Error: &Error{err.Error()}})
return writeHeader(w, http.StatusInternalServerError)
}

return writeHeader(w, http.StatusOK)
}

func postFix(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
Expand Down

0 comments on commit 8209922

Please sign in to comment.