From c317d6f2656d864a2031d0ac8898a3c46d2c93cc Mon Sep 17 00:00:00 2001 From: Shobhit Gupta Date: Tue, 23 Oct 2018 04:19:10 -0700 Subject: 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 --- app/command.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app') 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 } -- cgit v1.2.3-1-g7c22