mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
Paging function for users and repositories
This commit is contained in:
parent
7ffdabb28f
commit
63cc14062a
9 changed files with 71 additions and 7 deletions
|
@ -589,6 +589,12 @@ func CreateRepository(u *User, name, desc, lang, license string, private, mirror
|
|||
return repo, nil
|
||||
}
|
||||
|
||||
// CountRepositories returns number of repositories.
|
||||
func CountRepositories() int64 {
|
||||
count, _ := x.Count(new(Repository))
|
||||
return count
|
||||
}
|
||||
|
||||
// GetRepositoriesWithUsers returns given number of repository objects with offset.
|
||||
// It also auto-gets corresponding users.
|
||||
func GetRepositoriesWithUsers(num, offset int) ([]*Repository, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue