Fix: perPage logic in `getPagination`

This commit is contained in:
j 2020-01-17 22:17:14 +05:30
parent 3cba2fea51
commit f6878130a5
1 changed files with 2 additions and 2 deletions

View File

@ -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
}
}