Fix to be able to specify multiple id for GetAccountRelationships

This commit is contained in:
178inaba 2017-04-18 02:45:40 +09:00
parent a7e0c19d35
commit 6f244235d4

View File

@ -194,12 +194,14 @@ func (c *Client) AccountUnmute(ctx context.Context, id int64) (*Relationship, er
} }
// GetAccountRelationship return relationship for the account. // 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 := url.Values{}
params.Set("id", fmt.Sprint(id)) for _, id := range ids {
params.Add("id[]", fmt.Sprint(id))
}
var relationships []*Relationship 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 { if err != nil {
return nil, err return nil, err
} }