big ole refactor
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
func SeasonLeaguePage(
|
||||
s *hws.Server,
|
||||
conn *bun.DB,
|
||||
conn *db.DB,
|
||||
) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
seasonStr := r.PathValue("season_short_name")
|
||||
@@ -25,7 +25,7 @@ func SeasonLeaguePage(
|
||||
var teams []*db.Team
|
||||
var allTeams []*db.Team
|
||||
|
||||
if ok := db.WithReadTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
if ok := conn.WithReadTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
var err error
|
||||
season, league, teams, err = db.GetSeasonLeague(ctx, tx, seasonStr, leagueStr)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user