diff options
author | Unknwon <u@gogs.io> | 2016-07-24 14:32:46 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-24 14:32:46 +0800 |
commit | e74630ae3b635a43a1bdafcf8b80d2f87b3536b6 (patch) | |
tree | 63c5fb32b6ca4417c3dfd9c05f532d5598aa4117 /models/user.go | |
parent | 1f2e173a745da8e4b57f96b5561a3c10054d3b76 (diff) | |
download | gitea-e74630ae3b635a43a1bdafcf8b80d2f87b3536b6.tar.gz gitea-e74630ae3b635a43a1bdafcf8b80d2f87b3536b6.zip |
#1384 add pagination for repositories
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go index 5b1fd4ae51..a22162dc2d 100644 --- a/models/user.go +++ b/models/user.go @@ -402,12 +402,17 @@ func (u *User) GetOrganizationCount() (int64, error) { return u.getOrganizationCount(x) } -// GetRepositories returns all repositories that user owns, including private repositories. -func (u *User) GetRepositories() (err error) { - u.Repos, err = GetRepositories(u.ID, true) +// GetRepositories returns repositories that user owns, including private repositories. +func (u *User) GetRepositories(page, pageSize int) (err error) { + u.Repos, err = GetUserRepositories(u.ID, true, page, pageSize) return err } +// GetRepositories returns mirror repositories that user owns, including private repositories. +func (u *User) GetMirrorRepositories() ([]*Repository, error) { + return GetUserMirrorRepositories(u.ID) +} + // GetOwnedOrganizations returns all organizations that user owns. func (u *User) GetOwnedOrganizations() (err error) { u.OwnedOrgs, err = GetOwnedOrgsByUserID(u.ID) |