Adds the endpoints and store logic to get groups by team and by channel (#10502)
* Adds the endpoints and store logic to get groups by team and by channel * Remove TODO comments * Fix unit tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
25fd962016
Коммит
2ce48aa6d1
16
app/group.go
16
app/group.go
@@ -164,3 +164,19 @@ 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)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
return result.Data.([]*model.Group), nil
|
||||
}
|
||||
|
||||
func (a *App) GetGroupsByTeam(teamId string, page, perPage int) ([]*model.Group, *model.AppError) {
|
||||
result := <-a.Srv.Store.Group().GetGroupsByTeam(teamId, page, perPage)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
return result.Data.([]*model.Group), nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user