feat: add register for users
This commit is contained in:
+4
-3
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user