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
Этот коммит содержится в:
Miguel de la Cruz
2019-04-02 21:02:51 +01:00
коммит произвёл GitHub
родитель 25fd962016
Коммит 2ce48aa6d1
15 изменённых файлов: 777 добавлений и 38 удалений

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

@@ -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
}