diff options
author | Eric Multanen <eric.w.multanen@intel.com> | 2020-10-16 23:22:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-10-16 23:22:22 +0000 |
commit | 2573d840571cb511e27ba5ef663a4b99bc717a45 (patch) | |
tree | 2d31e9e307082f0c419a433837a64dc4afc9b633 | |
parent | edaf4416c5002254b60199a0b9710ebb23ccdf7b (diff) | |
parent | 0c527d07b604fc9ecad713732c3d9bb5d5ace31e (diff) |
Merge "delete should return 404 error for invalid name"
-rw-r--r-- | src/orchestrator/api/composite_app_handler.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/orchestrator/api/composite_app_handler.go b/src/orchestrator/api/composite_app_handler.go index d531b28d..761d60b9 100644 --- a/src/orchestrator/api/composite_app_handler.go +++ b/src/orchestrator/api/composite_app_handler.go @@ -130,7 +130,12 @@ func (h compositeAppHandler) deleteHandler(w http.ResponseWriter, r *http.Reques version := vars["version"] projectName := vars["project-name"] - err := h.client.DeleteCompositeApp(name, version, projectName) + _, err := h.client.GetCompositeApp(name, version, projectName) + if err != nil { + http.Error(w, err.Error(), http.StatusNotFound) + return + } + err = h.client.DeleteCompositeApp(name, version, projectName) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return |