chore: update admin apis

This commit is contained in:
Krispire Admin
2026-06-16 15:48:44 +05:30
parent 4c42d9a7f9
commit 04ad94ad3c
4 changed files with 35 additions and 16 deletions
+10
View File
@@ -46,6 +46,16 @@ func meta(total, limit, offset int) *response.Meta {
}
}
// Stats — GET /admin/stats → system snapshot for the dashboard home.
func (h *AdminHandler) Stats(w http.ResponseWriter, r *http.Request) {
snap, err := h.svc.Stats(r.Context())
if err != nil {
response.Error(w, http.StatusInternalServerError, "could not load stats")
return
}
response.JSON(w, http.StatusOK, snap)
}
func (h *AdminHandler) ListUsers(w http.ResponseWriter, r *http.Request) {
q, limit, offset := pageParams(r)
items, total, err := h.svc.ListUsers(r.Context(), q, limit, offset)