From 6f244235d46c1782be8360084ffef7d9e3e25127 Mon Sep 17 00:00:00 2001 From: 178inaba <178inaba@users.noreply.github.com> Date: Tue, 18 Apr 2017 02:45:40 +0900 Subject: [PATCH] Fix to be able to specify multiple id for GetAccountRelationships --- accounts.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/accounts.go b/accounts.go index 9e0b17d..a6d1e75 100644 --- a/accounts.go +++ b/accounts.go @@ -194,12 +194,14 @@ func (c *Client) AccountUnmute(ctx context.Context, id int64) (*Relationship, er } // GetAccountRelationship return relationship for the account. -func (c *Client) GetAccountRelationship(ctx context.Context, id int64) ([]*Relationship, error) { +func (c *Client) GetAccountRelationships(ctx context.Context, ids []int64) ([]*Relationship, error) { params := url.Values{} - params.Set("id", fmt.Sprint(id)) + for _, id := range ids { + params.Add("id[]", fmt.Sprint(id)) + } var relationships []*Relationship - err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/relationship", params, &relationships) + err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/relationships", params, &relationships) if err != nil { return nil, err }