MM-14897: Changes to be able to add and remove groups from channels. (#10794)
* MM-15162: Changes for LDAP groups removals phase. * MM-14897: Changes to be able to add and remove groups from channels. * Update model/client4.go * MM-14897: PR-requested change to string interpolation.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
dd33bc13a7
Коммит
1b78f9debc
16
app/group.go
16
app/group.go
@@ -165,12 +165,20 @@ func (a *App) ChannelMembersToRemove() ([]*model.ChannelMember, *model.AppError)
|
||||
return result.Data.([]*model.ChannelMember), nil
|
||||
}
|
||||
|
||||
func (a *App) GetGroupsByChannel(channelId string, page, perPage int) ([]*model.Group, *model.AppError) {
|
||||
result := <-a.Srv.Store.Group().GetGroupsByChannel(channelId, page, perPage)
|
||||
func (a *App) GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.Group, int, *model.AppError) {
|
||||
result := <-a.Srv.Store.Group().GetGroupsByChannel(channelId, opts)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
return nil, 0, result.Err
|
||||
}
|
||||
return result.Data.([]*model.Group), nil
|
||||
groups := result.Data.([]*model.Group)
|
||||
|
||||
result = <-a.Srv.Store.Group().CountGroupsByChannel(channelId, opts)
|
||||
if result.Err != nil {
|
||||
return nil, 0, result.Err
|
||||
}
|
||||
count := result.Data.(int64)
|
||||
|
||||
return groups, int(count), nil
|
||||
}
|
||||
|
||||
func (a *App) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.Group, int, *model.AppError) {
|
||||
|
||||
Ссылка в новой задаче
Block a user