diff options
Diffstat (limited to 'cmd/platform/team.go')
-rw-r--r-- | cmd/platform/team.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/platform/team.go b/cmd/platform/team.go index 8fecda6e1..43d0b2582 100644 --- a/cmd/platform/team.go +++ b/cmd/platform/team.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/mattermost/platform/api" + "github.com/mattermost/platform/app" "github.com/mattermost/platform/model" "github.com/spf13/cobra" ) @@ -92,10 +93,8 @@ func createTeamCmdF(cmd *cobra.Command, args []string) error { Type: teamType, } - c := getMockContext() - api.CreateTeam(c, team) - if c.Err != nil { - return errors.New("Team creation failed: " + c.Err.Error()) + if _, err := app.CreateTeam(team); err != nil { + return errors.New("Team creation failed: " + err.Error()) } return nil @@ -156,7 +155,7 @@ func addUserToTeam(team *model.Team, user *model.User, userArg string) { CommandPrintErrorln("Can't find user '" + userArg + "'") return } - if err := api.JoinUserToTeam(team, user); err != nil { + if err := app.JoinUserToTeam(team, user); err != nil { CommandPrintErrorln("Unable to add '" + userArg + "' to " + team.Name) } } |