diff options
Diffstat (limited to 'internal/client/github.go')
| -rw-r--r-- | internal/client/github.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/client/github.go b/internal/client/github.go index f8b7097..35e8b2c 100644 --- a/internal/client/github.go +++ b/internal/client/github.go @@ -58,19 +58,30 @@ func (c *Client) SearchGitHubLeads(query string, callback func(result json.RawMe return nil } -func (c *Client) SearchGitHubLeadsWithParams(query, sort, exclude string, callback func(result json.RawMessage) error) error { +func (c *Client) SearchGitHubLeadsWithParams(query, sort, exclude, format, bio string, callback func(result json.RawMessage) error) error { path := "/github/leads" params := url.Values{} - params.Set("q", query) + if query != "" { + params.Set("q", query) + } if sort != "" { params.Set("sort", sort) } if exclude != "" { params.Set("exclude", exclude) } + if format != "" { + params.Set("format", format) + } + if bio != "" { + params.Set("bio", bio) + } - fullURL := c.config.BaseURL + path + "?" + params.Encode() + fullURL := c.config.BaseURL + path + if len(params) > 0 { + fullURL += "?" + params.Encode() + } req, err := http.NewRequest(http.MethodGet, fullURL, nil) if err != nil { |
