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

Method restoreNote

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

Source from the content-addressed store, hash-verified

666}
667
668func (s *Server) restoreNote(w http.ResponseWriter, r *http.Request) {
669 var req struct {
670 Path string `json:"path"`
671 }
672 if err := readJSON(r, &req); err != nil {
673 http.Error(w, err.Error(), http.StatusBadRequest)
674 return
675 }
676 meta, err := s.currentVault().RestoreFromTrash(req.Path)
677 if err != nil {
678 writeError(w, err)
679 return
680 }
681 writeJSON(w, http.StatusOK, meta)
682}
683
684func (s *Server) emptyTrash(w http.ResponseWriter, _ *http.Request) {
685 if err := s.currentVault().EmptyTrash(); err != nil {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected