diff options
author | Shobhit Gupta <smartyshobhit@gmail.com> | 2018-10-23 04:19:10 -0700 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-10-23 12:19:10 +0100 |
commit | c317d6f2656d864a2031d0ac8898a3c46d2c93cc (patch) | |
tree | ff58ed977a0d38d3a7918f8b056f33feea9fe0c4 /app | |
parent | 6232ff3738a2e5e52469dc23840bb96385b5d8ea (diff) | |
download | chat-c317d6f2656d864a2031d0ac8898a3c46d2c93cc.tar.gz chat-c317d6f2656d864a2031d0ac8898a3c46d2c93cc.tar.bz2 chat-c317d6f2656d864a2031d0ac8898a3c46d2c93cc.zip |
MM-12356 Add cli command "command delete" (#9553)
* Add cli command for deleting commands
* Add code/test for delete command
* Fix test
* Add confirm flag
* Update as per comments
* Uncomment test
* Fix test
Diffstat (limited to 'app')
-rw-r--r-- | app/command.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/command.go b/app/command.go index 5c7ff6ecf..e1cdc627b 100644 --- a/app/command.go +++ b/app/command.go @@ -423,10 +423,9 @@ func (a *App) DeleteCommand(commandId string) *model.AppError { if !*a.Config().ServiceSettings.EnableCommands { return model.NewAppError("DeleteCommand", "api.command.disabled.app_error", nil, "", http.StatusNotImplemented) } - - if err := (<-a.Srv.Store.Command().Delete(commandId, model.GetMillis())).Err; err != nil { - return err + result := <-a.Srv.Store.Command().Delete(commandId, model.GetMillis()) + if result.Err != nil { + return result.Err } - return nil } |