(w http.ResponseWriter, r *http.Request)
| 666 | } |
| 667 | |
| 668 | func (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 | |
| 684 | func (s *Server) emptyTrash(w http.ResponseWriter, _ *http.Request) { |
| 685 | if err := s.currentVault().EmptyTrash(); err != nil { |
nothing calls this directly
no test coverage detected