(w http.ResponseWriter, r *http.Request)
| 618 | } |
| 619 | |
| 620 | func (s *Server) renameNote(w http.ResponseWriter, r *http.Request) { |
| 621 | var req struct { |
| 622 | Path string `json:"path"` |
| 623 | Title string `json:"title"` |
| 624 | } |
| 625 | if err := readJSON(r, &req); err != nil { |
| 626 | http.Error(w, err.Error(), http.StatusBadRequest) |
| 627 | return |
| 628 | } |
| 629 | meta, err := s.currentVault().RenameNote(req.Path, req.Title) |
| 630 | if err != nil { |
| 631 | writeError(w, err) |
| 632 | return |
| 633 | } |
| 634 | writeJSON(w, http.StatusOK, meta) |
| 635 | } |
| 636 | |
| 637 | func (s *Server) deleteNote(w http.ResponseWriter, r *http.Request) { |
| 638 | var req struct { |
nothing calls this directly
no test coverage detected