Skip to content

Commit

Permalink
Merge pull request #51 from josejibin/fix/per-page-logic
Browse files Browse the repository at this point in the history
Fix: perPage logic in `getPagination`
  • Loading branch information
knadh authored Jan 17, 2020
2 parents 3cba2fe + f687813 commit e230bac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ func getPagination(q url.Values) pagination {
perPage = 0
} else {
ppi, _ := strconv.Atoi(pp)
if ppi < 1 || ppi > maxPerPage {
perPage = defaultPerPage
if ppi > 0 && ppi <= maxPerPage {
perPage = ppi
}
}

Expand Down

0 comments on commit e230bac

Please sign in to comment.