MCPcopy
hub / github.com/ZenNotes/zennotes / writeComments

Method writeComments

apps/server/internal/httpserver/server.go:548–563  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

546}
547
548func (s *Server) writeComments(w http.ResponseWriter, r *http.Request) {
549 var req struct {
550 Path string `json:"path"`
551 Comments []vault.NoteComment `json:"comments"`
552 }
553 if err := readJSON(r, &req); err != nil {
554 http.Error(w, err.Error(), http.StatusBadRequest)
555 return
556 }
557 comments, err := s.currentVault().WriteNoteComments(req.Path, req.Comments)
558 if err != nil {
559 writeError(w, err)
560 return
561 }
562 writeJSON(w, http.StatusOK, comments)
563}
564
565func (s *Server) writeNote(w http.ResponseWriter, r *http.Request) {
566 cfg := s.currentConfig()

Callers

nothing calls this directly

Calls 6

currentVaultMethod · 0.95
readJSONFunction · 0.85
writeErrorFunction · 0.85
writeJSONFunction · 0.85
ErrorMethod · 0.80
WriteNoteCommentsMethod · 0.80

Tested by

no test coverage detected