fix(backend,frontend) remake update profile

This commit is contained in:
2026-05-09 11:42:41 +03:00
parent fe331026aa
commit 92e440deb0
14 changed files with 508 additions and 91 deletions
+6 -2
View File
@@ -35,9 +35,7 @@ func main() {
api := r.Group("/api")
{
api.POST("/register", handlers.Register)
api.POST("/login", handlers.Login)
protected := api.Group("/")
protected.Use(middleware.AuthRequired())
{
@@ -47,8 +45,14 @@ func main() {
protected.POST("/parts", handlers.CreatePart)
protected.POST("/parts/bulk", handlers.ImportParts)
protected.PATCH("/parts/:id/status", handlers.UpdateStatus)
protected.PATCH("/user/update", handlers.UpdateProfile)
protected.DELETE("/parts/:id", handlers.DeletePart)
}
admin := protected.Group("/")
admin.Use(middleware.AdminOnly())
{
admin.POST("/register", handlers.Register)
}
}