PLT-7218: CLI to move slash commands between teams. (#7574)

Этот коммит содержится в:
George Goldberg
2017-10-04 19:08:59 +01:00
коммит произвёл Chris
родитель e16bdf8d1d
Коммит f3fc6d11fa
9 изменённых файлов: 252 добавлений и 1 удалений

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

@@ -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)