more refactors
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func AdminDashboard(s *hws.Server, conn *bun.DB) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
var users *db.Users
|
||||
var users *db.List[db.User]
|
||||
if ok := db.WithReadTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
var err error
|
||||
users, err = db.GetUsers(ctx, tx, nil)
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// AdminUsersList shows all users
|
||||
func AdminUsersList(s *hws.Server, conn *bun.DB) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
var users *db.Users
|
||||
var users *db.List[db.User]
|
||||
pageOpts := pageOptsFromForm(s, w, r)
|
||||
if pageOpts == nil {
|
||||
return
|
||||
|
||||
@@ -20,7 +20,7 @@ func SeasonsPage(
|
||||
if pageOpts == nil {
|
||||
return
|
||||
}
|
||||
var seasons *db.SeasonList
|
||||
var seasons *db.List[db.Season]
|
||||
if ok := db.WithReadTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
var err error
|
||||
seasons, err = db.ListSeasons(ctx, tx, pageOpts)
|
||||
@@ -44,7 +44,7 @@ func SeasonsList(
|
||||
if pageOpts == nil {
|
||||
return
|
||||
}
|
||||
var seasons *db.SeasonList
|
||||
var seasons *db.List[db.Season]
|
||||
if ok := db.WithReadTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
|
||||
var err error
|
||||
seasons, err = db.ListSeasons(ctx, tx, pageOpts)
|
||||
|
||||
Reference in New Issue
Block a user