ソースを参照

Merge branch 'v3' into context-support

pull/25/head
Matt Baer 1年前
committed by GitHub
コミット
2e3644c55b
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
2個のファイルの変更7行の追加3行の削除
  1. +6
    -2
      collection.go
  2. +1
    -1
      go.mod

+ 6
- 2
collection.go ファイルの表示

@@ -92,9 +92,13 @@ func (c *Client) GetCollection(ctx context.Context, alias string) (*Collection,
// GetCollectionPosts retrieves a collection's posts, returning the Posts
// and any error (in user-friendly form) that occurs. See
// https://developers.write.as/docs/api/#retrieve-collection-posts
func (c *Client) GetCollectionPosts(ctx context.Context, alias string) (*[]Post, error) {
func (c *Client) GetCollectionPosts(ctx context.Context, alias string, page int) (*[]Post, error) {
coll := &Collection{}
env, err := c.get(ctx, fmt.Sprintf("/collections/%s/posts", alias), coll)
q := ""
if page > 0 {
q = fmt.Sprintf("?page=%d", page)
}
env, err := c.get(ctx, fmt.Sprintf("/collections/%s/posts%s", alias, q), coll)
if err != nil {
return nil, err
}


+ 1
- 1
go.mod ファイルの表示

@@ -1,4 +1,4 @@
module github.com/writeas/go-writeas/v2
module github.com/writeas/go-writeas/v3

go 1.9



読み込み中…
キャンセル
保存