(w http.ResponseWriter, r *http.Request)
| 546 | } |
| 547 | |
| 548 | func (s *Server) writeComments(w http.ResponseWriter, r *http.Request) { |
| 549 | var req struct { |
| 550 | Path string `json:"path"` |
| 551 | Comments []vault.NoteComment `json:"comments"` |
| 552 | } |
| 553 | if err := readJSON(r, &req); err != nil { |
| 554 | http.Error(w, err.Error(), http.StatusBadRequest) |
| 555 | return |
| 556 | } |
| 557 | comments, err := s.currentVault().WriteNoteComments(req.Path, req.Comments) |
| 558 | if err != nil { |
| 559 | writeError(w, err) |
| 560 | return |
| 561 | } |
| 562 | writeJSON(w, http.StatusOK, comments) |
| 563 | } |
| 564 | |
| 565 | func (s *Server) writeNote(w http.ResponseWriter, r *http.Request) { |
| 566 | cfg := s.currentConfig() |
nothing calls this directly
no test coverage detected