diff --git a/server/badge.go b/server/badge.go index ed3947de..455bd90a 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 a9518844..c66807d6 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