Migrate Channel.GetChannelsByIds to Sync by default (#11197)
* Migrate Channel.GetChannelsByIds to Sync by default * remove <-
Этот коммит содержится в:
коммит произвёл
Gabe Jackson
родитель
f97e6368c8
Коммит
7d08efc335
@@ -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)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user