chore: build
This commit is contained in:
@@ -635,7 +635,12 @@ func UpdateProduct(c *gin.Context) {
|
||||
|
||||
log.Printf("🔄 [UpdateProduct] %s met à jour produit #%d", username, id)
|
||||
|
||||
if err := database.UpdateProduct(id, updateData.Name, updateData.Category, updateData.Description, updateData.Unit, updateData.Prices); err != nil {
|
||||
comingSoon := false
|
||||
if updateData.ComingSoon != nil {
|
||||
comingSoon = *updateData.ComingSoon
|
||||
}
|
||||
|
||||
if err := database.UpdateProduct(id, updateData.Name, updateData.Category, updateData.Description, updateData.Unit, comingSoon, updateData.Prices); err != nil {
|
||||
log.Printf("❌ [UpdateProduct] Erreur UPDATE: %v", err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Erreur mise à jour"})
|
||||
return
|
||||
@@ -647,12 +652,6 @@ func UpdateProduct(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
if updateData.ComingSoon != nil {
|
||||
if err := database.SetProductComingSoon(id, *updateData.ComingSoon); err != nil {
|
||||
log.Printf("⚠️ [UpdateProduct] Erreur mise à jour coming_soon: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// ✅ RÉCUPÉRER LE PRODUIT MIS À JOUR
|
||||
updatedProduct, _ := database.GetProductByID(id)
|
||||
media, _ := database.GetMediaByProductID(id)
|
||||
|
||||
Reference in New Issue
Block a user