added team view to season_leagues

This commit is contained in:
2026-02-20 19:57:06 +11:00
parent 60120e9d0e
commit e8b492ce4d
25 changed files with 1018 additions and 51 deletions

View File

@@ -21,12 +21,11 @@ func SeasonLeagueStatsPage(
seasonStr := r.PathValue("season_short_name")
leagueStr := r.PathValue("league_short_name")
var season *db.Season
var league *db.League
var sl *db.SeasonLeague
if ok := conn.WithReadTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
var err error
season, league, _, err = db.GetSeasonLeague(ctx, tx, seasonStr, leagueStr)
sl, err = db.GetSeasonLeague(ctx, tx, seasonStr, leagueStr)
if err != nil {
if db.IsBadRequest(err) {
throw.NotFound(s, w, r, r.URL.Path)
@@ -40,7 +39,7 @@ func SeasonLeagueStatsPage(
}
if r.Method == "GET" {
renderSafely(seasonsview.SeasonLeagueStatsPage(season, league), s, r, w)
renderSafely(seasonsview.SeasonLeagueStatsPage(sl.Season, sl.League), s, r, w)
} else {
renderSafely(seasonsview.SeasonLeagueStats(), s, r, w)
}