[MM-26532] Support "active" filter on profile search (#14923)

* Support "active" filter on profile search

* Add tests for active user filter
Этот коммит содержится в:
Michael Kochell
2020-06-29 15:52:46 -04:00
коммит произвёл GitHub
родитель bec2f366a7
Коммит 11bc28b5fb
6 изменённых файлов: 115 добавлений и 0 удалений

Просмотреть файл

@@ -939,6 +939,17 @@ func (c *Client4) GetRecentlyActiveUsersInTeam(teamId string, page int, perPage
return UserListFromJson(r.Body), BuildResponse(r)
}
// GetActiveUsersInTeam returns a page of users on a team. Page counting starts at 0.
func (c *Client4) GetActiveUsersInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response) {
query := fmt.Sprintf("?active=true&in_team=%v&page=%v&per_page=%v", teamId, page, perPage)
r, err := c.DoApiGet(c.GetUsersRoute()+query, etag)
if err != nil {
return nil, BuildErrorResponse(r, err)
}
defer closeBody(r)
return UserListFromJson(r.Body), BuildResponse(r)
}
// GetUsersNotInTeam returns a page of users who are not in a team. Page counting starts at 0.
func (c *Client4) GetUsersNotInTeam(teamId string, page int, perPage int, etag string) ([]*User, *Response) {
query := fmt.Sprintf("?not_in_team=%v&page=%v&per_page=%v", teamId, page, perPage)

Просмотреть файл

@@ -20,6 +20,8 @@ type UserGetOptions struct {
WithoutTeam bool
// Filters the inactive users
Inactive bool
// Filters the active users
Active bool
// Filters for the given role
Role string
// Sorting option