From b8c534cd0da918626bc590d533874d20545a91a7 Mon Sep 17 00:00:00 2001 From: Quentin Machu Date: Fri, 5 Feb 2016 15:37:34 -0500 Subject: [PATCH] api: fix putVulnerability (fill missing Namespace.Name and Name fields) --- api/v1/routes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/v1/routes.go b/api/v1/routes.go index 799b7e4b..1e4a2cb5 100644 --- a/api/v1/routes.go +++ b/api/v1/routes.go @@ -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()}})