From 7a8ce9083de43a8f38d09db668446efd48783b2a Mon Sep 17 00:00:00 2001 From: LeonG11 Date: Tue, 23 Jun 2026 20:57:11 +0300 Subject: [PATCH] fix: correct mistakes letters in word --- backend/handlers/cart_handler.go | 6 +++--- frontend/src/pages/Shop.jsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/handlers/cart_handler.go b/backend/handlers/cart_handler.go index da0ff3c..06468e3 100644 --- a/backend/handlers/cart_handler.go +++ b/backend/handlers/cart_handler.go @@ -20,7 +20,7 @@ func GetCart(c *gin.Context) { userID := getUserID(c) var cartItems []models.CartItem - if err := database.DB.Preload("Item").Where("user_id=?", userID).Find(&cartItems).Error; err != nil { + if err := database.DB.Preload("Item").Where("user_id = ?", userID).Find(&cartItems).Error; err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": "Не удалось получить корзину"}) return } @@ -39,8 +39,8 @@ func AddToCart(c *gin.Context) { userID := getUserID(c) var req struct { - ItemID uint `json:"item_id" bindind:"required"` - Quantity float64 `json:"quantity" bindind:"required,gt=0"` + ItemID uint `json:"item_id" binding:"required"` + Quantity float64 `json:"quantity" binding:"required,gt=0"` } if err := c.ShouldBindJSON(&req); err != nil { diff --git a/frontend/src/pages/Shop.jsx b/frontend/src/pages/Shop.jsx index 4baf902..fca1227 100644 --- a/frontend/src/pages/Shop.jsx +++ b/frontend/src/pages/Shop.jsx @@ -38,7 +38,7 @@ export default function Shop() { try { await api.addToCart({ item_id: product.id, - quanity: selectedWeight, + quantity: selectedWeight, }); alert(`${product.name} добавлен в корзину`); } catch (err) {