refactor: pagination/pager (#39162)

This commit is contained in:
wxiaoguang
2026-08-29 08:20:46 +02:00
committed by GitHub
parent 9297205f2c
commit fedf219e77
42 changed files with 133 additions and 131 deletions
+1 -2
View File
@@ -312,12 +312,11 @@ func prepareUserProfileTabData(ctx *context.Context, profileDbRepo *repo_model.R
return
}
pager := context.NewPagination(total, pagingNum, page, 5)
pager := context.NewPagerBuilder(ctx).TotalCount(total).PerPageLimit(pagingNum).CurPage(page).Build()
if tab == "activity" {
// FIXME: UNLIMITE-PAGING-ONE-MORE-ROW: see another comment
pager.WithUnlimitedPaging(curRows, curRows == pagingNum)
}
pager.AddParamFromRequest(ctx.Req)
ctx.Data["Page"] = pager
}