Mark unread turn summaries in the switcher and Project rows
This commit is contained in:
@@ -99,6 +99,32 @@ func (s *Server) SetFocus(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, f)
|
||||
}
|
||||
|
||||
func (s *Server) GetSummaryReads(w http.ResponseWriter, r *http.Request) {
|
||||
reads, err := s.store.SummaryReads(r.Context(), actor(r))
|
||||
if err != nil {
|
||||
writeStoreError(w, err)
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, reads)
|
||||
}
|
||||
|
||||
func (s *Server) MarkSummaryRead(w http.ResponseWriter, r *http.Request, taskId string) {
|
||||
body := api.SummaryRead{}
|
||||
if !readJSON(w, r, &body) {
|
||||
return
|
||||
}
|
||||
if body.Seq <= 0 {
|
||||
writeError(w, http.StatusBadRequest, errors.New("seq must be positive"))
|
||||
return
|
||||
}
|
||||
err := s.store.MarkSummaryRead(r.Context(), actor(r), taskId, body.Seq)
|
||||
if err != nil {
|
||||
writeStoreError(w, err)
|
||||
return
|
||||
}
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
func (s *Server) SetPaneFocus(w http.ResponseWriter, r *http.Request) {
|
||||
p := api.PaneFocus{}
|
||||
if !readJSON(w, r, &p) {
|
||||
|
||||
Reference in New Issue
Block a user