PLT-4938 Add app package and move logic over from api package (#4931)

* Add app package and move logic over from api package

* Change app package functions to return errors

* Move non-api tests into app package

* Fix merge
Этот коммит содержится в:
Joram Wilander
2017-01-13 13:53:37 -05:00
коммит произвёл GitHub
родитель 07bad4d6d5
Коммит 97558f6a6e
85 изменённых файлов: 3368 добавлений и 2997 удалений

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

@@ -6,7 +6,7 @@ import (
"fmt"
"strings"
"github.com/mattermost/platform/api"
"github.com/mattermost/platform/app"
"github.com/mattermost/platform/model"
)
@@ -42,7 +42,7 @@ func getChannelFromChannelArg(channelArg string) *model.Channel {
return nil
}
if result := <-api.Srv.Store.Channel().GetByNameIncludeDeleted(team.Id, channelPart); result.Err == nil {
if result := <-app.Srv.Store.Channel().GetByNameIncludeDeleted(team.Id, channelPart); result.Err == nil {
channel = result.Data.(*model.Channel)
} else {
fmt.Println(result.Err.Error())
@@ -50,7 +50,7 @@ func getChannelFromChannelArg(channelArg string) *model.Channel {
}
if channel == nil {
if result := <-api.Srv.Store.Channel().Get(channelPart, true); result.Err == nil {
if result := <-app.Srv.Store.Channel().Get(channelPart, true); result.Err == nil {
channel = result.Data.(*model.Channel)
}
}