MM-16258: Adds new API endpoint + (App & Client & Store) to retrieve … (#11176)

* MM-16258: Adds new API endpoint + (App & Client & Store) to retrieve Users who would be removed from a list of hypothetical group IDs representing the synced groups.

* MM-16258: Adds roles to JSON response.

* MM-16258: Updates GetByIDs to use Squirrel.

* MM-16258: Puts as much as possible into Squirrel.

* MM-16258: Changes names of methods, functions, and route.

* MM-16258: Updates some comments.

* MM-16258: Extra validation of group_ids parameter.

* MM-16258: Changes validation of group_ids query param.

* MM-16258: Rename a variable and a constant.

* MM-16258: Fix test.
Этот коммит содержится в:
Martin Kraft
2019-06-17 09:51:56 -04:00
коммит произвёл GitHub
родитель 5ee1f6e2e0
Коммит 9d41c7a583
10 изменённых файлов: 615 добавлений и 0 удалений

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

@@ -4412,3 +4412,15 @@ func (c *Client4) PatchGroupSyncable(groupID, syncableID string, syncableType Gr
defer closeBody(r)
return GroupSyncableFromJson(r.Body), BuildResponse(r)
}
func (c *Client4) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page, perPage int, etag string) ([]*UserWithGroups, int64, *Response) {
groupIDStr := strings.Join(groupIDs, ",")
query := fmt.Sprintf("?group_ids=%s&page=%d&per_page=%d", groupIDStr, page, perPage)
r, err := c.DoApiGet(c.GetTeamRoute(teamID)+"/members_minus_group_members"+query, etag)
if err != nil {
return nil, 0, BuildErrorResponse(r, err)
}
defer closeBody(r)
ugc := UsersWithGroupsAndCountFromJson(r.Body)
return ugc.Users, ugc.Count, BuildResponse(r)
}