chore: fix

This commit is contained in:
2026-05-03 19:38:29 +02:00
parent 4075ae2568
commit f8473b9a54
27 changed files with 608 additions and 115 deletions
+17
View File
@@ -61,6 +61,23 @@ func CreditClientReferralAdmin(c *gin.Context) {
})
}
// ResetClientReferralAdmin — DELETE /api/v2/admin/protected/client/:username/referral/reset (admin)
func ResetClientReferralAdmin(c *gin.Context) {
database := c.MustGet("database").(*db.Database)
targetUsername := c.Param("username")
if err := database.ResetClientReferralBalance(targetUsername); err != nil {
utils.ServerErr(c, "Impossible de réinitialiser le solde", err)
return
}
log.Printf("✅ [REFERRAL] Solde parrainage remis à zéro pour %s", targetUsername)
c.JSON(http.StatusOK, gin.H{
"message": "Solde parrainage réinitialisé",
"balance": 0,
})
}
// GetClientReferralAdmin — GET /api/v2/admin/protected/client/:username/referral (admin)
func GetClientReferralAdmin(c *gin.Context) {
database := c.MustGet("database").(*db.Database)