Migrate Channel.GetChannelsByIds to Sync by default (#11197)

* Migrate Channel.GetChannelsByIds to Sync by default

* remove <-
Этот коммит содержится в:
Sheshagiri Rao Mallipedhi
2019-06-18 00:15:51 +05:30
коммит произвёл Gabe Jackson
родитель f97e6368c8
Коммит 7d08efc335
6 изменённых файлов: 44 добавлений и 41 удалений

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

@@ -1759,11 +1759,11 @@ func (a *App) AutocompleteChannels(teamId string, term string) (*model.ChannelLi
channelList := model.ChannelList{}
if len(channelIds) > 0 {
cresult := <-a.Srv.Store.Channel().GetChannelsByIds(channelIds)
if cresult.Err != nil {
return nil, cresult.Err
channels, err := a.Srv.Store.Channel().GetChannelsByIds(channelIds)
if err != nil {
return nil, err
}
for _, c := range cresult.Data.([]*model.Channel) {
for _, c := range channels {
if c.DeleteAt > 0 && !includeDeleted {
continue
}

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

@@ -2154,11 +2154,11 @@ func (a *App) getListOfAllowedChannelsForTeam(teamId string, viewRestrictions *m
return channelIds, nil
}
cresult := <-a.Srv.Store.Channel().GetChannelsByIds(viewRestrictions.Channels)
if cresult.Err != nil {
return nil, cresult.Err
channels, err := a.Srv.Store.Channel().GetChannelsByIds(viewRestrictions.Channels)
if err != nil {
return nil, err
}
for _, c := range cresult.Data.([]*model.Channel) {
for _, c := range channels {
if c.TeamId == teamId {
listOfAllowedChannels = append(listOfAllowedChannels, c.Id)
}