summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-03-29 21:11:40 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-03-29 21:11:40 -0400
commit6ac87d82e38c83e3b9b3bd12c3122e047f0110b1 (patch)
treeaa3f0f8f41df7c987f8bb62756ca3d8259ecbaa1 /model/client4.go
parenta4764a5c10ec59820eec7338d97be48d41c1a4d6 (diff)
downloadchat-6ac87d82e38c83e3b9b3bd12c3122e047f0110b1.tar.gz
chat-6ac87d82e38c83e3b9b3bd12c3122e047f0110b1.tar.bz2
chat-6ac87d82e38c83e3b9b3bd12c3122e047f0110b1.zip
PLT-2713 Added ability for admins to list users not in any team (#5844)
* PLT-2713 Added ability for admins to list users not in any team * Updated style of unit test
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index c3697e3c9..27f8328f4 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -500,6 +500,17 @@ func (c *Client4) GetUsersNotInChannel(teamId, channelId string, page int, perPa
}
}
+// GetUsersWithoutTeam returns a page of users on the system that aren't on any teams. Page counting starts at 0.
+func (c *Client4) GetUsersWithoutTeam(page int, perPage int, etag string) ([]*User, *Response) {
+ query := fmt.Sprintf("?without_team=1&page=%v&per_page=%v", page, perPage)
+ if r, err := c.DoApiGet(c.GetUsersRoute()+query, etag); err != nil {
+ return nil, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return UserListFromJson(r.Body), BuildResponse(r)
+ }
+}
+
// GetUsersByIds returns a list of users based on the provided user ids.
func (c *Client4) GetUsersByIds(userIds []string) ([]*User, *Response) {
if r, err := c.DoApiPost(c.GetUsersRoute()+"/ids", ArrayToJson(userIds)); err != nil {