Migrate multiples methods from ChannelStore to return error interface (#14708)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-06-16 04:56:35 -04:00
коммит произвёл GitHub
родитель 09a0b7db61
Коммит e342b5a2f2
16 изменённых файлов: 105 добавлений и 90 удалений

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

@@ -1052,7 +1052,7 @@ func getChannelByName(c *Context, w http.ResponseWriter, r *http.Request) {
}
} else {
if !c.App.SessionHasPermissionToChannel(*c.App.Session(), channel.Id, model.PERMISSION_READ_CHANNEL) {
c.Err = model.NewAppError("getChannelByName", store.MISSING_CHANNEL_ERROR, nil, "teamId="+channel.TeamId+", "+"name="+channel.Name+"", http.StatusNotFound)
c.Err = model.NewAppError("getChannelByName", "app.channel.get_by_name.missing.app_error", nil, "teamId="+channel.TeamId+", "+"name="+channel.Name+"", http.StatusNotFound)
return
}
}
@@ -1080,7 +1080,7 @@ func getChannelByNameForTeamName(c *Context, w http.ResponseWriter, r *http.Requ
}
if !c.App.SessionHasPermissionToChannel(*c.App.Session(), channel.Id, model.PERMISSION_READ_CHANNEL) {
c.Err = model.NewAppError("getChannelByNameForTeamName", store.MISSING_CHANNEL_ERROR, nil, "teamId="+channel.TeamId+", "+"name="+channel.Name+"", http.StatusNotFound)
c.Err = model.NewAppError("getChannelByNameForTeamName", "app.channel.get_by_name.missing.app_error", nil, "teamId="+channel.TeamId+", "+"name="+channel.Name+"", http.StatusNotFound)
return
}