fix: correct mistakes letters in word
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user