Fix to be able to specify multiple id for GetAccountRelationships
This commit is contained in:
parent
a7e0c19d35
commit
6f244235d4
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user