diff --git a/server/badge.go b/server/badge.go index ed3947de8..455bd90a9 100644 --- a/server/badge.go +++ b/server/badge.go @@ -72,7 +72,7 @@ func GetCC(c *gin.Context) { return } - builds, err := store.GetBuildList(c, repo) + builds, err := store.GetBuildList(c, repo, 1) if err != nil || len(builds) == 0 { c.AbortWithStatus(404) return diff --git a/server/build.go b/server/build.go index a9518844c..c66807d6a 100644 --- a/server/build.go +++ b/server/build.go @@ -25,7 +25,13 @@ import ( func GetBuilds(c *gin.Context) { repo := session.Repo(c) - builds, err := store.GetBuildList(c, repo) + page, err := strconv.Atoi(c.DefaultQuery("page", "1")) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + return + } + + builds, err := store.GetBuildList(c, repo, page) if err != nil { c.AbortWithStatus(http.StatusInternalServerError) return