delete regisrty

Удалена регистрация пользователем, осталась только логин через форму,
причесал api на бекенде
This commit is contained in:
2026-05-07 21:13:22 +03:00
parent 87ec792fd5
commit fe331026aa
2 changed files with 27 additions and 40 deletions
+15 -12
View File
@@ -33,20 +33,23 @@ func main() {
c.Next()
})
r.POST("/register", handlers.Register)
r.POST("/login", handlers.Login)
protected := r.Group("/api")
protected.Use(middleware.AuthRequired())
api := r.Group("/api")
{
protected.GET("/parts/:id", handlers.GetPart)
protected.GET("/parts", handlers.GetAllParts)
protected.GET("/orders", handlers.GetsOrders)
protected.POST("/parts", handlers.CreatePart)
protected.POST("/parts/bulk", handlers.ImportParts)
protected.PATCH("/parts/:id/status", handlers.UpdateStatus)
protected.DELETE("/parts/:id", handlers.DeletePart)
api.POST("/register", handlers.Register)
api.POST("/login", handlers.Login)
protected := api.Group("/")
protected.Use(middleware.AuthRequired())
{
protected.GET("/parts/:id", handlers.GetPart)
protected.GET("/parts", handlers.GetAllParts)
protected.GET("/orders", handlers.GetsOrders)
protected.POST("/parts", handlers.CreatePart)
protected.POST("/parts/bulk", handlers.ImportParts)
protected.PATCH("/parts/:id/status", handlers.UpdateStatus)
protected.DELETE("/parts/:id", handlers.DeletePart)
}
}
r.Run(":8090")