DeleteBook deletes a book in the server
(ctx context.DnoteCtx, uuid string)
| 383 | |
| 384 | // DeleteBook deletes a book in the server |
| 385 | func DeleteBook(ctx context.DnoteCtx, uuid string) (DeleteBookResp, error) { |
| 386 | endpoint := fmt.Sprintf("/v3/books/%s", uuid) |
| 387 | res, err := doAuthorizedReq(ctx, "DELETE", endpoint, "", nil) |
| 388 | if err != nil { |
| 389 | return DeleteBookResp{}, errors.Wrap(err, "deleting a book in the server") |
| 390 | } |
| 391 | |
| 392 | var resp DeleteBookResp |
| 393 | if err := json.NewDecoder(res.Body).Decode(&resp); err != nil { |
| 394 | return resp, errors.Wrap(err, "decoding the response") |
| 395 | } |
| 396 | |
| 397 | return resp, nil |
| 398 | } |
| 399 | |
| 400 | // CreateNotePayload is a payload for creating a note |
| 401 | type CreateNotePayload struct { |
no test coverage detected