(w http.ResponseWriter, r *http.Request)
| 650 | } |
| 651 | |
| 652 | func (s *Server) trashNote(w http.ResponseWriter, r *http.Request) { |
| 653 | var req struct { |
| 654 | Path string `json:"path"` |
| 655 | } |
| 656 | if err := readJSON(r, &req); err != nil { |
| 657 | http.Error(w, err.Error(), http.StatusBadRequest) |
| 658 | return |
| 659 | } |
| 660 | meta, err := s.currentVault().MoveToTrash(req.Path) |
| 661 | if err != nil { |
| 662 | writeError(w, err) |
| 663 | return |
| 664 | } |
| 665 | writeJSON(w, http.StatusOK, meta) |
| 666 | } |
| 667 | |
| 668 | func (s *Server) restoreNote(w http.ResponseWriter, r *http.Request) { |
| 669 | var req struct { |
nothing calls this directly
no test coverage detected