V3Index is a v3 handler for getting notes
(w http.ResponseWriter, r *http.Request)
| 143 | |
| 144 | // V3Index is a v3 handler for getting notes |
| 145 | func (n *Notes) V3Index(w http.ResponseWriter, r *http.Request) { |
| 146 | result, _, err := n.getNotes(r) |
| 147 | if err != nil { |
| 148 | handleJSONError(w, err, "getting notes") |
| 149 | return |
| 150 | } |
| 151 | |
| 152 | respondJSON(w, http.StatusOK, GetNotesResponse{ |
| 153 | Notes: presenters.PresentNotes(result.Notes), |
| 154 | Total: result.Total, |
| 155 | }) |
| 156 | } |
| 157 | |
| 158 | func (n *Notes) getNote(r *http.Request) (database.Note, error) { |
| 159 | user := context.User(r.Context()) |
nothing calls this directly
no test coverage detected