MCPcopy Index your code
hub / github.com/dnote/dnote / apiCreateNote

Function apiCreateNote

pkg/e2e/sync/testutils.go:194–204  ·  view source on GitHub ↗

apiCreateNote creates a note via the API and returns its UUID

(t *testing.T, env testEnv, user database.User, bookUUID, body, message string)

Source from the content-addressed store, hash-verified

192
193// apiCreateNote creates a note via the API and returns its UUID
194func apiCreateNote(t *testing.T, env testEnv, user database.User, bookUUID, body, message string) string {
195 res := doHTTPReq(t, env, "POST", "/v3/notes", fmt.Sprintf(`{"book_uuid": "%s", "content": "%s"}`, bookUUID, body), message, user)
196
197 var resp controllers.CreateNoteResp
198 if err := json.NewDecoder(res.Body).Decode(&resp); err != nil {
199 t.Fatal(errors.Wrap(err, "decoding payload for adding note"))
200 return ""
201 }
202
203 return resp.Result.UUID
204}
205
206// apiPatchNote updates a note via the API
207func apiPatchNote(t *testing.T, env testEnv, user database.User, noteUUID, payload, message string) {

Callers 7

TestSync_EmptyServerFunction · 0.85
TestSync_onewayFunction · 0.85
TestSync_twowayFunction · 0.85
TestSyncFunction · 0.85
TestFullSyncFunction · 0.85

Calls 1

doHTTPReqFunction · 0.85

Tested by 7

TestSync_EmptyServerFunction · 0.68
TestSync_onewayFunction · 0.68
TestSync_twowayFunction · 0.68
TestSyncFunction · 0.68
TestFullSyncFunction · 0.68