Migrates Channel.GetChannels to sync by default (#11204)

* Migrates Channel.GetChannels to sync by default

* Some suggestions

* resolved undefined var
Этот коммит содержится в:
Rodrigo Villablanca Vásquez
2019-06-20 03:31:40 -04:00
коммит произвёл Jesús Espino
родитель 3c13b0e4e7
Коммит 327a1c92e8
7 изменённых файлов: 47 добавлений и 51 удалений

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

@@ -823,14 +823,12 @@ func (a *App) LeaveTeam(team *model.Team, user *model.User, requestorId string)
var channelList *model.ChannelList
if result := <-a.Srv.Store.Channel().GetChannels(team.Id, user.Id, true); result.Err != nil {
if result.Err.Id == "store.sql_channel.get_channels.not_found.app_error" {
if channelList, err = a.Srv.Store.Channel().GetChannels(team.Id, user.Id, true); err != nil {
if err.Id == "store.sql_channel.get_channels.not_found.app_error" {
channelList = &model.ChannelList{}
} else {
return result.Err
return err
}
} else {
channelList = result.Data.(*model.ChannelList)
}
for _, channel := range *channelList {