fix: count of total page in pagination
@@ -47,7 +47,10 @@ func (h *Handlers) setPaginationDefault(page, perPage *int) {
}
func (h *Handlers) setPaginationLinkHeader(ctx *gin.Context, page, perPage, totalCount int) {
- totalPage := totalCount/perPage + 1
+ totalPage := totalCount / perPage
+ if totalCount%perPage > 0 {
+ totalPage++
+ }
var prevPage int
if page == 1 {
