MM-48186: Add a new API endpoint to add a user to their default GroupChannels and GroupTeams. (#21591)

* MM-48186: Add a new API endpoint to add a user to their default GroupChannels and GroupTeams.

* MM-48186: Removed unrelated lint fixes.

* MM-48186: Removed variable from previous iteration.

* MM-48186: Adds translation.

* MM-48186: Not upgrading golang.org/x/text in this pr.

* MM-48186: Validate user ID and auth service.

* MM-48186: Use user id from struct.

* MM-48186: Added basic client test.

* MM-48186: Adds empty translation.

* MM-48186: Added translations.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Martin Kraft
2022-11-21 13:36:41 -05:00
коммит произвёл GitHub
родитель 25bb1d0ebd
Коммит fcd45de73b
9 изменённых файлов: 227 добавлений и 20 удалений

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

@@ -8458,3 +8458,12 @@ func (c *Client4) GetNewTeamMembersSince(teamID string, timeRange string, page i
}
return newTeamMembersList, BuildResponse(r), nil
}
func (c *Client4) AddUserToGroupSyncables(userID string) (*Response, error) {
r, err := c.DoAPIPost(c.ldapRoute()+"/users/"+userID+"/group_sync_memberships", "")
if err != nil {
return BuildResponse(r), err
}
defer closeBody(r)
return BuildResponse(r), nil
}

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

@@ -247,3 +247,11 @@ type GroupsWithCount struct {
Groups []*Group `json:"groups"`
TotalCount int64 `json:"total_count"`
}
type CreateDefaultMembershipParams struct {
Since int64
ReAddRemovedMembers bool
ScopedUserID *string
ScopedTeamID *string
ScopedChannelID *string
}