mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 05:00:01 +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
|
@ -212,6 +212,12 @@ func CreateUser(u *User) (*User, error) {
|
|||
return u, err
|
||||
}
|
||||
|
||||
// CountUsers returns number of users.
|
||||
func CountUsers() int64 {
|
||||
count, _ := x.Where("type=0").Count(new(User))
|
||||
return count
|
||||
}
|
||||
|
||||
// GetUsers returns given number of user objects with offset.
|
||||
func GetUsers(num, offset int) ([]User, error) {
|
||||
users := make([]User, 0, num)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue