diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-11-24 11:49:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 03:49:41 +0000 |
commit | df1e7d0067bb39913eb681ccc920649884fb1938 (patch) | |
tree | 2419feab5c28658adb7f71878df646bdc9bdc50e /cmd/admin_auth.go | |
parent | d24a8223ce1e47a0c9b103aae07f67c3112ca048 (diff) | |
download | gitea-df1e7d0067bb39913eb681ccc920649884fb1938.tar.gz gitea-df1e7d0067bb39913eb681ccc920649884fb1938.zip |
Use db.Find instead of writing methods for every object (#28084)
For those simple objects, it's unnecessary to write the find and count
methods again and again.
Diffstat (limited to 'cmd/admin_auth.go')
-rw-r--r-- | cmd/admin_auth.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/admin_auth.go b/cmd/admin_auth.go index 014ddf329f..ec92e342d4 100644 --- a/cmd/admin_auth.go +++ b/cmd/admin_auth.go @@ -9,6 +9,7 @@ import ( "text/tabwriter" auth_model "code.gitea.io/gitea/models/auth" + "code.gitea.io/gitea/models/db" auth_service "code.gitea.io/gitea/services/auth" "github.com/urfave/cli/v2" @@ -62,7 +63,7 @@ func runListAuth(c *cli.Context) error { return err } - authSources, err := auth_model.FindSources(ctx, auth_model.FindSourcesOptions{}) + authSources, err := db.Find[auth_model.Source](ctx, auth_model.FindSourcesOptions{}) if err != nil { return err } |