chore: build
This commit is contained in:
@@ -544,11 +544,22 @@ func GetAllUsers(c *gin.Context) {
|
||||
|
||||
log.Printf("✅ [GET_ALL_USERS] %d users récupérés (offset=%d, total=%d)", len(sanitized), offset, total)
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
resp := gin.H{
|
||||
"users": sanitized,
|
||||
"count": total,
|
||||
"has_more": int64(offset+len(users)) < total,
|
||||
})
|
||||
}
|
||||
// Totaux globaux par rôle (indépendants de la pagination) : uniquement
|
||||
// sur la première page, c'est là que le front les lit.
|
||||
if offset == 0 {
|
||||
if counts, err := database.GetUserCounts(); err != nil {
|
||||
log.Printf("⚠️ [GET_ALL_USERS] Comptage par rôle impossible: %v", err)
|
||||
} else {
|
||||
resp["counts"] = counts
|
||||
}
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
func GetAllDeliveryMen(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user