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

Method V3Create

pkg/server/controllers/books.go:164–175  ·  view source on GitHub ↗

V3Create creates a book

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

Source from the content-addressed store, hash-verified

162
163// V3Create creates a book
164func (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
177type updateBookPayload struct {
178 Name *string `schema:"name" json:"name"`

Callers

nothing calls this directly

Calls 4

createMethod · 0.95
PresentBookFunction · 0.92
handleJSONErrorFunction · 0.85
respondJSONFunction · 0.85

Tested by

no test coverage detected