Files
core/pkg/analytics/analytics.go

18 lines
404 B
Go
Raw Normal View History

2026-04-02 10:57:36 -04:00
package analytics
import (
"encoding/json"
"net/http"
)
func (h *Handler) HandleGetAnalyticsSummary(w http.ResponseWriter, r *http.Request) {
summary, err := h.Store.GetAnalyticsSummary(r.Context())
if err != nil {
http.Error(w, "Failed to generate analytics", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(summary)
}