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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
61b7226533
Коммит
d3a285e64d
@@ -5,7 +5,7 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/mattermost/platform/api"
|
||||
"github.com/mattermost/platform/app"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -49,7 +49,7 @@ func makeSystemAdminCmdF(cmd *cobra.Command, args []string) error {
|
||||
return errors.New("Unable to find user '" + args[i] + "'")
|
||||
}
|
||||
|
||||
if _, err := api.UpdateUserRoles(user, "system_admin system_user"); err != nil {
|
||||
if _, err := app.UpdateUserRoles(user.Id, "system_admin system_user"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func makeMemberCmdF(cmd *cobra.Command, args []string) error {
|
||||
return errors.New("Unable to find user '" + args[i] + "'")
|
||||
}
|
||||
|
||||
if _, err := api.UpdateUserRoles(user, "system_user"); err != nil {
|
||||
if _, err := app.UpdateUserRoles(user.Id, "system_user"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user