mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Add Pagination to Releases-page
This commit is contained in:
parent
be5607e510
commit
86fb1a0cb1
3 changed files with 14 additions and 3 deletions
|
@ -138,8 +138,11 @@ func GetReleaseByID(id int64) (*Release, error) {
|
|||
}
|
||||
|
||||
// GetReleasesByRepoID returns a list of releases of repository.
|
||||
func GetReleasesByRepoID(repoID int64) (rels []*Release, err error) {
|
||||
err = x.Desc("created_unix").Find(&rels, Release{RepoID: repoID})
|
||||
func GetReleasesByRepoID(repoID int64, page, pageSize int) (rels []*Release, err error) {
|
||||
if page <= 0 {
|
||||
page = 1
|
||||
}
|
||||
err = x.Desc("created_unix").Limit(pageSize, (page-1)*pageSize).Find(&rels, Release{RepoID: repoID})
|
||||
return rels, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue