From 4fc2c28d3b183bcad222bac6fd08fac0d0d69982 Mon Sep 17 00:00:00 2001 From: LeonG11 Date: Wed, 24 Jun 2026 10:46:15 +0300 Subject: [PATCH] fix: change POST user update profile and delete input.role --- backend/handlers/user_handler.go | 1 - backend/main.go | 1 + backend/models/update_user.go | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/handlers/user_handler.go b/backend/handlers/user_handler.go index 1fa2e04..655c358 100644 --- a/backend/handlers/user_handler.go +++ b/backend/handlers/user_handler.go @@ -154,7 +154,6 @@ func UpdateProfile(c *gin.Context) { FirstName: input.FirstName, LastName: input.LastName, Phone: input.Phone, - Role: input.Role, }).Error; err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": "Не удалось обновить данные", "details": err.Error()}) return diff --git a/backend/main.go b/backend/main.go index eb93bb7..09992c3 100644 --- a/backend/main.go +++ b/backend/main.go @@ -56,6 +56,7 @@ func main() { protected.POST("/orders/", handlers.CreateOrder) protected.GET("/orders", handlers.GetUserOrders) protected.GET("/orders/:id", handlers.GetOrder) + protected.PATCH("/profile", handlers.UpdateProfile) } admin := protected.Group("/admin") diff --git a/backend/models/update_user.go b/backend/models/update_user.go index f3e7e7a..d2943f3 100644 --- a/backend/models/update_user.go +++ b/backend/models/update_user.go @@ -4,5 +4,4 @@ type UpdateUserInput struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` Phone string `json:"phone"` - Role string `json:"role"` }