feat: add API getallorders and getorder by id
This commit is contained in:
@@ -54,12 +54,14 @@ func main() {
|
||||
protected.DELETE("/cart/:id", handlers.RemoveFromCart)
|
||||
protected.POST("/orders/", handlers.CreateOrder)
|
||||
protected.GET("/orders", handlers.GetUserOrders)
|
||||
protected.GET("/orders/:id", handlers.GetOrder)
|
||||
}
|
||||
|
||||
admin := protected.Group("/")
|
||||
admin.Use(middleware.AdminOnly())
|
||||
{
|
||||
admin.POST("/register", handlers.Register)
|
||||
admin.GET("/admin/orders", handlers.GetAllOrders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user