Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 694b136

Browse files
committed
Update SDK to match the return of /users/search
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 8718470 commit 694b136

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

gitea/user_search.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ package gitea
22

33
import "fmt"
44

5-
type searchUsersResponse struct {
6-
Users []*User `json:"data"`
5+
// UserSearchResults results of a succesful user search
6+
type UserSearchResults struct {
7+
OK bool `json:"ok"`
8+
Data []*User `json:"data"`
79
}
810

911
// SearchUsers finds users by query
1012
func (c *Client) SearchUsers(query string, limit int) ([]*User, error) {
11-
resp := new(searchUsersResponse)
13+
resp := new(UserSearchResults)
1214
err := c.getParsedResponse("GET", fmt.Sprintf("/users/search?q=%s&limit=%d", query, limit), nil, nil, &resp)
13-
return resp.Users, err
15+
return resp.Data, err
1416
}

0 commit comments

Comments
 (0)