MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / createNote

Method createNote

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

Source from the content-addressed store, hash-verified

582}
583
584func (s *Server) createNote(w http.ResponseWriter, r *http.Request) {
585 var req struct {
586 Folder vault.NoteFolder `json:"folder"`
587 Title string `json:"title"`
588 Subpath string `json:"subpath"`
589 }
590 if err := readJSON(r, &req); err != nil {
591 http.Error(w, err.Error(), http.StatusBadRequest)
592 return
593 }
594 meta, err := s.currentVault().CreateNote(req.Folder, req.Title, req.Subpath)
595 if err != nil {
596 writeError(w, err)
597 return
598 }
599 writeJSON(w, http.StatusOK, meta)
600}
601
602func (s *Server) createExcalidraw(w http.ResponseWriter, r *http.Request) {
603 var req struct {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected