diff options
author | George Goldberg <george@gberg.me> | 2017-10-04 19:08:59 +0100 |
---|---|---|
committer | Chris <ccbrown112@gmail.com> | 2017-10-04 11:08:59 -0700 |
commit | f3fc6d11fa11c9b8c73554c79ca55470073bb098 (patch) | |
tree | 1c0fa5181315bf2da312f7c832ae16f360d43d16 /app/command.go | |
parent | e16bdf8d1d4d2972be4e89cbc9c4dbef134895ba (diff) | |
download | chat-f3fc6d11fa11c9b8c73554c79ca55470073bb098.tar.gz chat-f3fc6d11fa11c9b8c73554c79ca55470073bb098.tar.bz2 chat-f3fc6d11fa11c9b8c73554c79ca55470073bb098.zip |
PLT-7218: CLI to move slash commands between teams. (#7574)
Diffstat (limited to 'app/command.go')
-rw-r--r-- | app/command.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/command.go b/app/command.go index d3e36b0e0..6e439537e 100644 --- a/app/command.go +++ b/app/command.go @@ -336,6 +336,16 @@ func (a *App) UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command, } } +func (a *App) MoveCommand(team *model.Team, command *model.Command) *model.AppError { + command.TeamId = team.Id + + if result := <-a.Srv.Store.Command().Update(command); result.Err != nil { + return result.Err + } + + return nil +} + func (a *App) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) { if !*utils.Cfg.ServiceSettings.EnableCommands { return nil, model.NewAppError("RegenCommandToken", "api.command.disabled.app_error", nil, "", http.StatusNotImplemented) |