Merge pull request #51 from josejibin/fix/per-page-logic

Fix: perPage logic in `getPagination`
This commit is contained in:
Kailash Nadh 2020-01-17 23:54:58 +05:30 committed by GitHub
commit e230baca3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -186,8 +186,8 @@ func getPagination(q url.Values) pagination {
perPage = 0 perPage = 0
} else { } else {
ppi, _ := strconv.Atoi(pp) ppi, _ := strconv.Atoi(pp)
if ppi < 1 || ppi > maxPerPage { if ppi > 0 && ppi <= maxPerPage {
perPage = defaultPerPage perPage = ppi
} }
} }