store: Return an error from DeleteBlueprint and DeleteBlueprintFromWorkspace

If an unknown blueprint or workspace is deleted it will now return an
error.

Also fixes the blueprints DELETE handlers to return the correct error to
the client. Includes a new test.
This commit is contained in:
Brian C. Lane 2020-03-10 17:01:04 -07:00 committed by Tom Gundersen
parent 2675eff4eb
commit b4710b52f1
3 changed files with 32 additions and 8 deletions

View file

@ -366,6 +366,7 @@ func TestBlueprintsDelete(t *testing.T) {
ExpectedJSON string
}{
{"DELETE", "/api/v0/blueprints/delete/test", ``, http.StatusOK, `{"status":true}`},
{"DELETE", "/api/v0/blueprints/delete/test3-non", ``, http.StatusBadRequest, `{"status":false,"errors":[{"id":"BlueprintsError","msg":"Unknown blueprint: test3-non"}]}`},
}
for _, c := range cases {