player profile added

This commit is contained in:
2026-03-06 19:51:27 +11:00
parent b57fbcd302
commit 788346d269
7 changed files with 341 additions and 4 deletions

View File

@@ -64,6 +64,11 @@ func addRoutes(
Methods: []hws.Method{hws.MethodGET, hws.MethodPOST},
Handler: auth.LoginReq(handlers.Logout(s, auth, conn, discordAPI)),
},
{
Path: "/profile",
Method: hws.MethodGET,
Handler: auth.LoginReq(handlers.ProfileRedirect(s)),
},
}
seasonRoutes := []hws.Route{
@@ -295,6 +300,19 @@ func addRoutes(
},
}
playerRoutes := []hws.Route{
{
Path: "/players/{player_id}",
Method: hws.MethodGET,
Handler: handlers.PlayerView(s, conn),
},
{
Path: "/players/{player_id}/link-slapid",
Method: hws.MethodPOST,
Handler: auth.LoginReq(handlers.LinkPlayerSlapID(s, conn, slapAPI)),
},
}
teamRoutes := []hws.Route{
{
Path: "/teams",
@@ -468,6 +486,7 @@ func addRoutes(
routes = append(routes, leagueRoutes...)
routes = append(routes, fixturesRoutes...)
routes = append(routes, teamRoutes...)
routes = append(routes, playerRoutes...)
// Register the routes with the server
err := s.AddRoutes(routes...)