Migrates Channel.GetChannels to sync by default (#11204)
* Migrates Channel.GetChannels to sync by default * Some suggestions * resolved undefined var
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
3c13b0e4e7
Коммит
327a1c92e8
@@ -1226,11 +1226,7 @@ func (a *App) GetChannelByNameForTeamName(channelName, teamName string, includeD
|
||||
}
|
||||
|
||||
func (a *App) GetChannelsForUser(teamId string, userId string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
||||
result := <-a.Srv.Store.Channel().GetChannels(teamId, userId, includeDeleted)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
return result.Data.(*model.ChannelList), nil
|
||||
return a.Srv.Store.Channel().GetChannels(teamId, userId, includeDeleted)
|
||||
}
|
||||
|
||||
func (a *App) GetAllChannels(page, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user