diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2022-04-20 12:43:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 18:43:26 +0800 |
commit | ae6a52440ac47b8d0eed5875de9d801bc68c1a4a (patch) | |
tree | f68c0c42b04165ee40acdac61e1299b8989acc1f /models/organization/team_repo.go | |
parent | 409ff55a293487868cfe034151d84de4cf4b4235 (diff) | |
download | gitea-ae6a52440ac47b8d0eed5875de9d801bc68c1a4a.tar.gz gitea-ae6a52440ac47b8d0eed5875de9d801bc68c1a4a.zip |
Fix panic in team repos API (#19431)
* Fix panic in team repos API
* Fix pagination
* fmt
Diffstat (limited to 'models/organization/team_repo.go')
-rw-r--r-- | models/organization/team_repo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/organization/team_repo.go b/models/organization/team_repo.go index 03ca4678a5..657e83aaa5 100644 --- a/models/organization/team_repo.go +++ b/models/organization/team_repo.go @@ -48,7 +48,7 @@ func GetTeamRepositories(ctx context.Context, opts *SearchTeamRepoOptions) ([]*r ) } if opts.PageSize > 0 { - sess.Limit(opts.PageSize, opts.Page*opts.PageSize) + sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize) } var repos []*repo_model.Repository return repos, sess.OrderBy("repository.name"). |