fix: SSE flusher support, null-safe API responses

- Add Flush() to statusRecorder so SSE works through logging middleware
- Return empty array instead of null for empty project lists
- Fixes 500 on /api/events and null.length crash on dashboard
This commit is contained in:
2026-03-28 13:48:20 +03:00
parent a8fcde87b5
commit 28abad27c6
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -27,6 +27,9 @@ func (s *Server) listProjects(w http.ResponseWriter, r *http.Request) {
respondError(w, http.StatusInternalServerError, "failed to list projects: "+err.Error())
return
}
if projects == nil {
projects = []store.Project{}
}
respondJSON(w, http.StatusOK, projects)
}