Skip to content

Commit c4d1974

Browse files
committed
use limit, not per_page
1 parent 95252d6 commit c4d1974

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

scm/driver/gitea/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func encodeListOptions(opts scm.ListOptions) string {
1717
params.Set("page", strconv.Itoa(opts.Page))
1818
}
1919
if opts.Size != 0 {
20-
params.Set("per_page", strconv.Itoa(opts.Size))
20+
params.Set("limit", strconv.Itoa(opts.Size))
2121
}
2222
return params.Encode()
2323
}
@@ -28,7 +28,7 @@ func encodeIssueListOptions(opts scm.IssueListOptions) string {
2828
params.Set("page", strconv.Itoa(opts.Page))
2929
}
3030
if opts.Size != 0 {
31-
params.Set("per_page", strconv.Itoa(opts.Size))
31+
params.Set("limit", strconv.Itoa(opts.Size))
3232
}
3333
if opts.Open && opts.Closed {
3434
params.Set("state", "all")
@@ -44,7 +44,7 @@ func encodePullRequestListOptions(opts scm.PullRequestListOptions) string {
4444
params.Set("page", strconv.Itoa(opts.Page))
4545
}
4646
if opts.Size != 0 {
47-
params.Set("per_page", strconv.Itoa(opts.Size))
47+
params.Set("limit", strconv.Itoa(opts.Size))
4848
}
4949
if opts.Open && opts.Closed {
5050
params.Set("state", "all")

scm/driver/gitea/util_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func Test_encodeListOptions(t *testing.T) {
1515
Page: 10,
1616
Size: 30,
1717
}
18-
want := "page=10&per_page=30"
18+
want := "page=10&limit=30"
1919
got := encodeListOptions(opts)
2020
if got != want {
2121
t.Errorf("Want encoded list options %q, got %q", want, got)
@@ -29,7 +29,7 @@ func Test_encodeIssueListOptions(t *testing.T) {
2929
Open: true,
3030
Closed: true,
3131
}
32-
want := "page=10&per_page=30&state=all"
32+
want := "page=10&limit=30&state=all"
3333
got := encodeIssueListOptions(opts)
3434
if got != want {
3535
t.Errorf("Want encoded issue list options %q, got %q", want, got)
@@ -43,7 +43,7 @@ func Test_encodeIssueListOptions_Closed(t *testing.T) {
4343
Open: false,
4444
Closed: true,
4545
}
46-
want := "page=10&per_page=30&state=closed"
46+
want := "page=10&limit=30&state=closed"
4747
got := encodeIssueListOptions(opts)
4848
if got != want {
4949
t.Errorf("Want encoded issue list options %q, got %q", want, got)
@@ -58,7 +58,7 @@ func Test_encodePullRequestListOptions(t *testing.T) {
5858
Open: true,
5959
Closed: true,
6060
}
61-
want := "page=10&per_page=30&state=all"
61+
want := "page=10&limit=30&state=all"
6262
got := encodePullRequestListOptions(opts)
6363
if got != want {
6464
t.Errorf("Want encoded pr list options %q, got %q", want, got)
@@ -73,7 +73,7 @@ func Test_encodePullRequestListOptions_Closed(t *testing.T) {
7373
Open: false,
7474
Closed: true,
7575
}
76-
want := "page=10&per_page=30&state=closed"
76+
want := "page=10&limit=30&state=closed"
7777
got := encodePullRequestListOptions(opts)
7878
if got != want {
7979
t.Errorf("Want encoded pr list options %q, got %q", want, got)

0 commit comments

Comments
 (0)