Skip to content

Commit 441681c

Browse files
committed
feat(release): add ptypes filter
1 parent 60aa12d commit 441681c

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/drycc/controller-sdk-go
22

3-
go 1.22.0
3+
go 1.23
44

55
require (
66
github.com/stretchr/testify v1.9.0

releases/releases.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ import (
1010
)
1111

1212
// List lists an app's releases.
13-
func List(c *drycc.Client, appID string, results int) ([]api.Release, int, error) {
13+
func List(c *drycc.Client, appID, ptypes string, results int) ([]api.Release, int, error) {
1414
u := fmt.Sprintf("/v2/apps/%s/releases/", appID)
15+
if ptypes != "" {
16+
u += fmt.Sprintf("?ptypes=%s", ptypes)
17+
}
1518

1619
body, count, reqErr := c.LimitedRequest(u, results)
1720

releases/releases_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func TestReleasesList(t *testing.T) {
192192
t.Fatal(err)
193193
}
194194

195-
actual, _, err := List(drycc, "example-go", 100)
195+
actual, _, err := List(drycc, "example-go", "", 100)
196196

197197
if err != nil {
198198
t.Fatal(err)

0 commit comments

Comments
 (0)