api: fix putVulnerability (fill missing Namespace.Name and Name fields)

This commit is contained in:
Quentin Machu 2016-02-05 15:37:34 -05:00 committed by Jimmy Zelinskie
parent c2061dc69e
commit b8c534cd0d

View File

@ -211,6 +211,9 @@ func putVulnerability(w http.ResponseWriter, r *http.Request, p httprouter.Param
return putVulnerabilityRoute, http.StatusBadRequest
}
vuln.Namespace.Name = p.ByName("namespaceName")
vuln.Name = p.ByName("vulnerabilityName")
err = ctx.Store.InsertVulnerabilities([]database.Vulnerability{vuln}, true)
if err != nil {
writeResponse(w, http.StatusInternalServerError, VulnerabilityEnvelope{Error: &Error{err.Error()}})