more refactors :)

This commit is contained in:
2026-02-08 20:52:58 +11:00
parent d038f7a42d
commit fa3b8e3982
10 changed files with 28 additions and 50 deletions

View File

@@ -30,7 +30,7 @@ func setPageOpts(q *bun.SelectQuery, p, d *PageOpts, totalitems int) (*bun.Selec
p.PerPage = d.PerPage
}
maxpage := p.TotalPages(totalitems)
if p.Page > maxpage {
if p.Page > maxpage && maxpage > 0 {
p.Page = maxpage
}
if p.Order == "" {