chore: update admin apis
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user