V3Create creates a book
(w http.ResponseWriter, r *http.Request)
| 162 | |
| 163 | // V3Create creates a book |
| 164 | func (b *Books) V3Create(w http.ResponseWriter, r *http.Request) { |
| 165 | result, err := b.create(r) |
| 166 | if err != nil { |
| 167 | handleJSONError(w, err, "creating a book") |
| 168 | return |
| 169 | } |
| 170 | |
| 171 | resp := CreateBookResp{ |
| 172 | Book: presenters.PresentBook(result), |
| 173 | } |
| 174 | respondJSON(w, http.StatusCreated, resp) |
| 175 | } |
| 176 | |
| 177 | type updateBookPayload struct { |
| 178 | Name *string `schema:"name" json:"name"` |
nothing calls this directly
no test coverage detected