Skip to content

Commit

Permalink
fix(api): fix pager returned an extra page
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptTF committed Apr 29, 2024
1 parent 4df7fb5 commit 79fdc17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/autogen/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func Pager(page *uint64, limit *uint64, count *uint64) (dbPage uint64, pageOut u
// We calculate the max page (0 if count is nil)
if count != nil {
maxPageFloat := float64(*count) / float64(limitOut)
maxPage = uint64(math.Ceil(maxPageFloat))
maxPage = uint64(math.Floor(maxPageFloat))
}

if pageOut > maxPage+1 {
Expand Down

0 comments on commit 79fdc17

Please sign in to comment.