organize user routes

This commit is contained in:
Chris Cromer 2023-01-27 23:51:05 -03:00 committed by Martin Araneda
parent c4880480ec
commit b9b88eaf0e

View File

@ -9,9 +9,11 @@ import (
func UserRoutes(router *httprouter.Router) {
router.POST("/login", controllers.Login)
router.GET("/users", middlewares.Authenticate(controllers.ListUsers))
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
router.GET("/users", middlewares.Authenticate(controllers.ListUsers))
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))
router.DELETE("/user/:id", middlewares.Authenticate(controllers.DeleteUser))
}