mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-06 03:48:45 +00:00
Add lists
This commit is contained in:
parent
c2f237e901
commit
c390a0c327
13 changed files with 322 additions and 33 deletions
|
@ -90,7 +90,7 @@ func (c *Client) DeleteList(ctx context.Context, id string) error {
|
|||
func (c *Client) AddToList(ctx context.Context, list string, accounts ...string) error {
|
||||
params := url.Values{}
|
||||
for _, acct := range accounts {
|
||||
params.Add("account_ids", string(acct))
|
||||
params.Add("account_ids[]", string(acct))
|
||||
}
|
||||
|
||||
return c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/lists/%s/accounts", url.PathEscape(string(list))), params, nil, nil)
|
||||
|
@ -100,7 +100,7 @@ func (c *Client) AddToList(ctx context.Context, list string, accounts ...string)
|
|||
func (c *Client) RemoveFromList(ctx context.Context, list string, accounts ...string) error {
|
||||
params := url.Values{}
|
||||
for _, acct := range accounts {
|
||||
params.Add("account_ids", string(acct))
|
||||
params.Add("account_ids[]", string(acct))
|
||||
}
|
||||
|
||||
return c.doAPI(ctx, http.MethodDelete, fmt.Sprintf("/api/v1/lists/%s/accounts", url.PathEscape(string(list))), params, nil, nil)
|
||||
|
|
|
@ -301,7 +301,7 @@ func (c *Client) DeleteStatus(ctx context.Context, id string) error {
|
|||
}
|
||||
|
||||
// Search search content with query.
|
||||
func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int, accountID string) (*Results, error) {
|
||||
func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int, accountID string, following bool) (*Results, error) {
|
||||
var results Results
|
||||
params := url.Values{}
|
||||
params.Set("q", q)
|
||||
|
@ -309,6 +309,7 @@ func (c *Client) Search(ctx context.Context, q string, qType string, limit int,
|
|||
params.Set("limit", fmt.Sprint(limit))
|
||||
params.Set("resolve", fmt.Sprint(resolve))
|
||||
params.Set("offset", fmt.Sprint(offset))
|
||||
params.Set("following", fmt.Sprint(following))
|
||||
if len(accountID) > 0 {
|
||||
params.Set("account_id", accountID)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue