V3Update updates a book
(w http.ResponseWriter, r *http.Request)
| 223 | |
| 224 | // V3Update updates a book |
| 225 | func (b *Books) V3Update(w http.ResponseWriter, r *http.Request) { |
| 226 | book, err := b.update(r) |
| 227 | if err != nil { |
| 228 | handleJSONError(w, err, "updating a book") |
| 229 | return |
| 230 | } |
| 231 | |
| 232 | resp := UpdateBookResp{ |
| 233 | Book: presenters.PresentBook(book), |
| 234 | } |
| 235 | respondJSON(w, http.StatusOK, resp) |
| 236 | } |
| 237 | |
| 238 | func (b *Books) del(r *http.Request) (database.Book, error) { |
| 239 | user := context.User(r.Context()) |
nothing calls this directly
no test coverage detected