diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-09-14 19:48:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 18:48:27 +0100 |
commit | 87505a9464a2c2c9d16547e06b0c922518dea73c (patch) | |
tree | b04d85857b76d506cadc6abe79f62180a78ff1d9 /models/repo.go | |
parent | 0a542dd59f8061797976f33690bf10357aa0b0ad (diff) | |
download | gitea-87505a9464a2c2c9d16547e06b0c922518dea73c.tar.gz gitea-87505a9464a2c2c9d16547e06b0c922518dea73c.zip |
Add `AbsoluteListOptions` (#17028)
This PR adds a `ListOptions` type which is not paged but uses absolute values. It is implemented as discussed in Discord.
Extracted from #16510 to clean that PR.
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 709fe6ab0e..575b8acbc8 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1770,7 +1770,7 @@ func GetUserRepositories(opts *SearchRepoOptions) ([]*Repository, int64, error) sess.Where(cond).OrderBy(opts.OrderBy.String()) repos := make([]*Repository, 0, opts.PageSize) - return repos, count, opts.setSessionPagination(sess).Find(&repos) + return repos, count, setSessionPagination(sess, opts).Find(&repos) } // GetUserMirrorRepositories returns a list of mirror repositories of given user. @@ -2061,7 +2061,7 @@ func (repo *Repository) GetForks(listOptions ListOptions) ([]*Repository, error) return forks, x.Find(&forks, &Repository{ForkID: repo.ID}) } - sess := listOptions.getPaginatedSession() + sess := getPaginatedSession(&listOptions) forks := make([]*Repository, 0, listOptions.PageSize) return forks, sess.Find(&forks, &Repository{ForkID: repo.ID}) } |