chore: build
Backend - Build & Lint / build (push) Canceled after 1m5s
Frontend Client - EAS Build / build (push) Canceled after 23s
Frontend Web - Build & Lint / build (push) Canceled after 0s

This commit is contained in:
Xor290
2026-09-10 19:26:05 +02:00
parent c69dc70680
commit f904a37964
6 changed files with 370 additions and 0 deletions
+10
View File
@@ -375,6 +375,16 @@ func ClaimMyReward(c *gin.Context) {
}
}
// Sans produit éligible pour ce pool (ex: catégories de la récompense mal
// alignées avec celles du pool), on refuse avant de consommer un point —
// sinon points_redeemed serait incrémenté sans qu'aucun produit ne soit
// jamais ajouté au panier (récompense perdue silencieusement).
if len(itemsToAdd) == 0 {
log.Printf("❌ [CLAIM] Aucun produit éligible pour %s (pool=%s)", username, req.PoolKey)
c.JSON(http.StatusConflict, gin.H{"error": "Récompense momentanément indisponible, contactez le support"})
return
}
remaining, added, err := database.ClaimPoolRewardAndAddToBasket(username, req.PoolKey, reward.Threshold, itemsToAdd)
if err != nil {
if strings.Contains(err.Error(), "pas de récompense disponible") {