Correlations: Add UpdateCorrelation HTTP API (#52444)

* Correlations: add UpdateCorrelation HTTP API

* handle correlation not found

* add tests

* fix lint errors

* add bad request to API spec

* change casing

* fix casing in docs

* fix tests

* update spec
This commit is contained in:
Giordano Ricci
2022-08-03 14:18:51 +01:00
committed by GitHub
parent f61a97a0ab
commit 09c4dbdb9f
9 changed files with 738 additions and 1 deletions
+19
View File
@@ -64,6 +64,25 @@ func (c TestContext) Post(params PostParams) *http.Response {
return resp
}
type PatchParams struct {
url string
body string
user User
}
func (c TestContext) Patch(params PatchParams) *http.Response {
c.t.Helper()
req, err := http.NewRequest(http.MethodPatch, c.getURL(params.url, params.user), bytes.NewBuffer([]byte(params.body)))
req.Header.Set("Content-Type", "application/json")
require.NoError(c.t, err)
resp, err := http.DefaultClient.Do(req)
require.NoError(c.t, err)
require.NoError(c.t, err)
return resp
}
type DeleteParams struct {
url string
user User