feat: add register for users

This commit is contained in:
2026-06-23 14:41:08 +03:00
parent 349b092d02
commit 3b2b4b947c
2 changed files with 47 additions and 7 deletions
+4 -3
View File
@@ -43,6 +43,7 @@ func main() {
api.GET("/items/:id", handlers.GetItem)
api.GET("/items/", handlers.GetAllItems)
api.GET("/getCategories", handlers.GetCategories)
api.POST("/register", handlers.Register)
protected.Use(middleware.AuthRequired())
{
protected.DELETE("/items/:id", handlers.DeleteItem)
@@ -57,11 +58,11 @@ func main() {
protected.GET("/orders/:id", handlers.GetOrder)
}
admin := protected.Group("/")
admin := protected.Group("/admin")
admin.Use(middleware.AdminOnly())
{
admin.POST("/register", handlers.Register)
admin.GET("/admin/orders", handlers.GetAllOrders)
admin.POST("/register", handlers.RegisterAdmin)
admin.GET("/orders", handlers.GetAllOrders)
}
}