DeleteNote removes a note in the server
(ctx context.DnoteCtx, uuid string)
| 498 | |
| 499 | // DeleteNote removes a note in the server |
| 500 | func 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 |
| 516 | type GetBooksResp []struct { |
no test coverage detected