Skip to content

Commit

Permalink
Add GetUsers pagination (closes #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohkinozomu authored and jbeemster committed Sep 23, 2022
1 parent f73b2e5 commit f131df0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redash/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ type UserUpdatePayload struct {
}

//GetUsers returns a paginated list of users
func (c *Client) GetUsers() (*UserList, error) {
func (c *Client) GetUsers(page, pageSize int) (*UserList, error) {
path := "/api/users"

query := url.Values{}
query.Add("page", strconv.Itoa(page))
query.Add("page_size", strconv.Itoa(pageSize))
response, err := c.get(path, query)

if err != nil {
Expand Down

0 comments on commit f131df0

Please sign in to comment.