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

Function DeleteNote

pkg/cli/client/client.go:500–513  ·  view source on GitHub ↗

DeleteNote removes a note in the server

(ctx context.DnoteCtx, uuid string)

Source from the content-addressed store, hash-verified

498
499// DeleteNote removes a note in the server
500func DeleteNote(ctx context.DnoteCtx, uuid string) (DeleteNoteResp, error) {
501 endpoint := fmt.Sprintf("/v3/notes/%s", uuid)
502 res, err := doAuthorizedReq(ctx, "DELETE", endpoint, "", nil)
503 if err != nil {
504 return DeleteNoteResp{}, errors.Wrap(err, "patching a note to the server")
505 }
506
507 var resp DeleteNoteResp
508 if err := json.NewDecoder(res.Body).Decode(&resp); err != nil {
509 return DeleteNoteResp{}, errors.Wrap(err, "decoding payload")
510 }
511
512 return resp, nil
513}
514
515// GetBooksResp is a response from get books endpoint
516type GetBooksResp []struct {

Callers 1

sendNotesFunction · 0.92

Calls 1

doAuthorizedReqFunction · 0.85

Tested by

no test coverage detected