Skip to content

Commit d4ea5a5

Browse files
committed
fix: use the page field from parameters
1 parent 975d98d commit d4ea5a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

routers/api/v1/projects/project.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,20 @@ func ListRepoProjects(ctx *context.APIContext) {
396396
// "$ref": "#/responses/forbidden"
397397
// "404":
398398
// "$ref": "#/responses/notFound"
399+
400+
page := ctx.FormInt("page")
399401
projects, count, err := db.FindAndCount[project_model.Project](ctx, project_model.SearchOptions{
400402
RepoID: ctx.Repo.Repository.ID,
401403
IsClosed: ctx.FormOptionalBool("closed"),
402404
Type: project_model.TypeRepository,
403-
ListOptions: db.ListOptions{Page: ctx.FormInt("page")},
405+
ListOptions: db.ListOptions{Page: page},
404406
})
405407
if err != nil {
406408
ctx.Error(http.StatusInternalServerError, "ListRepoProjects", err)
407409
return
408410
}
409411

410-
ctx.SetLinkHeader(int(count), setting.UI.IssuePagingNum)
412+
ctx.SetLinkHeader(int(count), page)
411413
ctx.SetTotalCountHeader(count)
412414

413415
apiProjects, err := convert.ToAPIProjectList(ctx, projects)

0 commit comments

Comments
 (0)