big ole refactor

This commit is contained in:
2026-02-14 19:48:59 +11:00
parent f0e7962af5
commit 8a79533de3
66 changed files with 989 additions and 1114 deletions

View File

@@ -14,11 +14,11 @@ import (
func LeaguesList(
s *hws.Server,
conn *bun.DB,
conn *db.DB,
) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var leagues []*db.League
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
leagues, err = db.GetLeagues(ctx, tx)
if err != nil {