Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

param name for client.AddToList should be account_ids[] not account_ids #181

Open
judell opened this issue Apr 6, 2023 · 0 comments
Open

Comments

@judell
Copy link

judell commented Apr 6, 2023

Currently the URL that's produced is like so:

https://social.coop/api/v1/lists/1064/accounts?account_ids=109348240344188934

Which returns 200 but does not add to the list.

This will actually add to the list:

https://social.coop/api/v1/lists/1064/accounts?account_ids[]=109348240344188934

I made this change to complete my task, but not raising a PR because I'm not sure where else this might be happening.

+++ b/lists.go
@@ -90,7 +90,7 @@ func (c *Client) DeleteList(ctx context.Context, id ID) error {
 func (c *Client) AddToList(ctx context.Context, list ID, accounts ...ID) error {
        params := url.Values{}
        for _, acct := range accounts {
-               params.Add("account_ids", string(acct))
+               params.Add("account_ids[]", string(acct))
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant