mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
fix: wrong pages number which includes private repository count. (#844)
This commit is contained in:
@ -1737,11 +1737,29 @@ func getRepositoryCount(e Engine, u *User) (int64, error) {
|
||||
return x.Count(&Repository{OwnerID: u.ID})
|
||||
}
|
||||
|
||||
func getPublicRepositoryCount(e Engine, u *User) (int64, error) {
|
||||
return x.Where("is_private = ?", false).Count(&Repository{OwnerID: u.ID})
|
||||
}
|
||||
|
||||
func getPrivateRepositoryCount(e Engine, u *User) (int64, error) {
|
||||
return x.Where("is_private = ?", true).Count(&Repository{OwnerID: u.ID})
|
||||
}
|
||||
|
||||
// GetRepositoryCount returns the total number of repositories of user.
|
||||
func GetRepositoryCount(u *User) (int64, error) {
|
||||
return getRepositoryCount(x, u)
|
||||
}
|
||||
|
||||
// GetPublicRepositoryCount returns the total number of public repositories of user.
|
||||
func GetPublicRepositoryCount(u *User) (int64, error) {
|
||||
return getPublicRepositoryCount(x, u)
|
||||
}
|
||||
|
||||
// GetPrivateRepositoryCount returns the total number of private repositories of user.
|
||||
func GetPrivateRepositoryCount(u *User) (int64, error) {
|
||||
return getPrivateRepositoryCount(x, u)
|
||||
}
|
||||
|
||||
// SearchRepoOptions holds the search options
|
||||
type SearchRepoOptions struct {
|
||||
Keyword string
|
||||
|
Reference in New Issue
Block a user