Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-09-03 00:29:57 -04:00
коммит произвёл GitHub
родитель 953899ad95
Коммит 54f86e7fb1
29 изменённых файлов: 1131 добавлений и 616 удалений

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

@@ -1528,8 +1528,13 @@ func (a *App) GetChannelByNameForTeamName(channelName, teamName string, includeD
team, err := a.Srv().Store.Team().GetByName(teamName)
if err != nil {
err.StatusCode = http.StatusNotFound
return nil, err
var nfErr *store.ErrNotFound
switch {
case errors.As(err, &nfErr):
return nil, model.NewAppError("GetChannelByNameForTeamName", "app.team.get_by_name.missing.app_error", nil, nfErr.Error(), http.StatusNotFound)
default:
return nil, model.NewAppError("GetChannelByNameForTeamName", "app.team.get_by_name.app_error", nil, err.Error(), http.StatusNotFound)
}
}
var result *model.Channel
@@ -2399,9 +2404,15 @@ func (a *App) MoveChannel(team *model.Team, channel *model.Channel, user *model.
}
// keep instance of the previous team
previousTeam, err := a.Srv().Store.Team().Get(channel.TeamId)
if err != nil {
return err
previousTeam, nErr := a.Srv().Store.Team().Get(channel.TeamId)
if nErr != nil {
var nfErr *store.ErrNotFound
switch {
case errors.As(nErr, &nfErr):
return model.NewAppError("MoveChannel", "app.team.get.find.app_error", nil, nfErr.Error(), http.StatusNotFound)
default:
return model.NewAppError("MoveChannel", "app.team.get.finding.app_error", nil, nErr.Error(), http.StatusInternalServerError)
}
}
if appErr := a.Srv().Store.Channel().UpdateSidebarChannelCategoryOnMove(channel, team.Id); appErr != nil {