From 6ff5400af91aefb02cbc7dd59f6be23cc2bf7865 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 14 Mar 2023 13:11:38 +0800 Subject: Make branches list page operations remember current page (#23420) Close #23411 Always pass "page" query parameter to backend, and make backend respect it. The `ctx.FormInt("limit")` is never used, so removed. --------- Co-authored-by: Jason Song Co-authored-by: Lunny Xiao --- modules/context/pagination.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/context') diff --git a/modules/context/pagination.go b/modules/context/pagination.go index 3effd88f10..5a88c92053 100644 --- a/modules/context/pagination.go +++ b/modules/context/pagination.go @@ -18,10 +18,11 @@ type Pagination struct { urlParams []string } -// NewPagination creates a new instance of the Pagination struct -func NewPagination(total, page, issueNum, numPages int) *Pagination { +// NewPagination creates a new instance of the Pagination struct. +// "pagingNum" is "page size" or "limit", "current" is "page" +func NewPagination(total, pagingNum, current, numPages int) *Pagination { p := &Pagination{} - p.Paginater = paginator.New(total, page, issueNum, numPages) + p.Paginater = paginator.New(total, pagingNum, current, numPages) return p } -- cgit v1.2.3