make game and user use the same structure for all of its endpoints
This commit is contained in:
parent
fea0ce3d04
commit
fcf6a91257
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func GameRoutes(router *httprouter.Router) {
|
func GameRoutes(router *httprouter.Router) {
|
||||||
router.GET("/games", middlewares.Authenticate(controllers.ListGames))
|
router.GET("/game", middlewares.Authenticate(controllers.ListGames))
|
||||||
router.GET("/game/:id", middlewares.Authenticate(controllers.GetGame))
|
router.GET("/game/:id", middlewares.Authenticate(controllers.GetGame))
|
||||||
router.POST("/game", controllers.CreateGame)
|
router.POST("/game", controllers.CreateGame)
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ func UserRoutes(router *httprouter.Router) {
|
|||||||
router.POST("/login", controllers.Login)
|
router.POST("/login", controllers.Login)
|
||||||
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
|
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
|
||||||
|
|
||||||
router.GET("/users", middlewares.Authenticate(controllers.ListUsers))
|
router.GET("/user", middlewares.Authenticate(controllers.ListUsers))
|
||||||
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
|
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
|
||||||
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
|
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
|
||||||
router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))
|
router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))
|
||||||
|
Loading…
Reference in New Issue
Block a user