added team view to season_leagues
This commit is contained in:
@@ -31,8 +31,7 @@ func GenerateFixtures(
|
||||
return
|
||||
}
|
||||
|
||||
var season *db.Season
|
||||
var league *db.League
|
||||
var sl *db.SeasonLeague
|
||||
var fixtures []*db.Fixture
|
||||
if ok := conn.WithNotifyTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
_, err := db.NewRound(ctx, tx, seasonShortName, leagueShortName, round, db.NewAuditFromRequest(r))
|
||||
@@ -43,7 +42,7 @@ func GenerateFixtures(
|
||||
}
|
||||
return false, errors.Wrap(err, "db.NewRound")
|
||||
}
|
||||
season, league, fixtures, err = db.GetFixtures(ctx, tx, seasonShortName, leagueShortName)
|
||||
sl, fixtures, err = db.GetFixtures(ctx, tx, seasonShortName, leagueShortName)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "db.GetFixtures")
|
||||
}
|
||||
@@ -52,7 +51,7 @@ func GenerateFixtures(
|
||||
return
|
||||
}
|
||||
|
||||
renderSafely(seasonsview.SeasonLeagueManageFixtures(season, league, fixtures), s, r, w)
|
||||
renderSafely(seasonsview.SeasonLeagueManageFixtures(sl.Season, sl.League, fixtures), s, r, w)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ func UpdateFixtures(
|
||||
|
||||
if !conn.WithNotifyTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
var err error
|
||||
_, _, fixtures, err = db.GetFixtures(ctx, tx, seasonShortName, leagueShortName)
|
||||
_, fixtures, err = db.GetFixtures(ctx, tx, seasonShortName, leagueShortName)
|
||||
if err != nil {
|
||||
if db.IsBadRequest(err) {
|
||||
respond.BadRequest(w, errors.Wrap(err, "db.NewRound"))
|
||||
|
||||
Reference in New Issue
Block a user