Fix: perPage logic in `getPagination`
This commit is contained in:
parent
3cba2fea51
commit
f6878130a5
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue