1
0
Fork 0
forked from forgejo/forgejo

Fix panic in team repos API (#19431)

* Fix panic in team repos API

* Fix pagination

* fmt
This commit is contained in:
qwerty287 2022-04-20 12:43:26 +02:00 committed by GitHub
parent 409ff55a29
commit ae6a52440a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -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").