Migrate functions to app package (#5106)

* Refactor and move session logic into app package

* Refactor email functions into the app package

* Refactor password update into app package

* Migrate user functions to app package

* Move team functions into app package

* Migrate channel functions into app package

* Pass SiteURL through to app functions

* Update based on feedback
Этот коммит содержится в:
Joram Wilander
2017-01-19 09:00:13 -05:00
коммит произвёл GitHub
родитель 61b7226533
Коммит d3a285e64d
34 изменённых файлов: 1974 добавлений и 1700 удалений

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

@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"github.com/mattermost/platform/api"
"github.com/mattermost/platform/app"
"github.com/mattermost/platform/model"
"github.com/spf13/cobra"
@@ -125,7 +124,7 @@ func removeUserFromTeam(team *model.Team, user *model.User, userArg string) {
CommandPrintErrorln("Can't find user '" + userArg + "'")
return
}
if err := api.LeaveTeam(team, user); err != nil {
if err := app.LeaveTeam(team, user); err != nil {
CommandPrintErrorln("Unable to remove '" + userArg + "' from " + team.Name + ". Error: " + err.Error())
}
}
@@ -200,5 +199,5 @@ func deleteTeamsCmdF(cmd *cobra.Command, args []string) error {
}
func deleteTeam(team *model.Team) *model.AppError {
return api.PermanentDeleteTeam(team)
return app.PermanentDeleteTeam(team)
}