Skip to content

Commit

Permalink
fix(api): assume more results exist if list not empty (#438)
Browse files Browse the repository at this point in the history
* fix(api): assume more results exist if list not empty

* update pagination logic to utilize same page size

* correct comment
  • Loading branch information
JordanSussman authored Jul 1, 2021
1 parent 2f71f80 commit 8a15f74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ func GetUserSourceRepos(c *gin.Context) {
// add repos to list of database org repos
dbRepos = append(dbRepos, dbReposPart...)

// making an assumption that 50 means there is another page
// assume no more pages exist if under 100 results are returned
//
// nolint: gomnd // ignore magic number
if len(dbReposPart) == 50 {
page++
} else {
if len(dbReposPart) < 100 {
page = 0
} else {
page++
}
}

Expand Down

0 comments on commit 8a15f74

Please sign in to comment.