From 79fdc179945f4ad7c1ef22463998f29eb7ea0c83 Mon Sep 17 00:00:00 2001 From: JULLIEN Baptiste Date: Mon, 29 Apr 2024 17:45:29 +0200 Subject: [PATCH] fix(api): fix pager returned an extra page --- backend/autogen/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/autogen/utils.go b/backend/autogen/utils.go index b90314f..9f1f7b2 100644 --- a/backend/autogen/utils.go +++ b/backend/autogen/utils.go @@ -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 {