From fcf6a9125770da2fa41a58d5d363521f5b99ae26 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 1 Feb 2023 12:52:26 -0300 Subject: [PATCH] make game and user use the same structure for all of its endpoints --- backend/routes/game.go | 2 +- backend/routes/user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/routes/game.go b/backend/routes/game.go index 742be3b..b9986db 100644 --- a/backend/routes/game.go +++ b/backend/routes/game.go @@ -8,7 +8,7 @@ import ( ) 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.POST("/game", controllers.CreateGame) } diff --git a/backend/routes/user.go b/backend/routes/user.go index 5c6cd73..4c5981f 100644 --- a/backend/routes/user.go +++ b/backend/routes/user.go @@ -11,7 +11,7 @@ func UserRoutes(router *httprouter.Router) { router.POST("/login", controllers.Login) 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.POST("/user", middlewares.Authenticate(controllers.CreateUser)) router.PATCH("/user/:id", middlewares.Authenticate(controllers.UpdateUser))