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

Method V3Update

pkg/server/controllers/books.go:225–236  ·  view source on GitHub ↗

V3Update updates a book

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

223
224// V3Update updates a book
225func (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
238func (b *Books) del(r *http.Request) (database.Book, error) {
239 user := context.User(r.Context())

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
PresentBookFunction · 0.92
handleJSONErrorFunction · 0.85
respondJSONFunction · 0.85

Tested by

no test coverage detected