diff options
author | Chris <ccbrown112@gmail.com> | 2017-07-31 08:52:45 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-07-31 11:52:45 -0400 |
commit | 72f61ab96aabf65c162c8d94b5b843b5108ee1a9 (patch) | |
tree | c80d7158613663a0b3f584a1736ef1cbff72d160 /store/sql_command_store.go | |
parent | 0f786a42d3289df9b4f5bdb4bddb0ecb07631608 (diff) | |
download | chat-72f61ab96aabf65c162c8d94b5b843b5108ee1a9.tar.gz chat-72f61ab96aabf65c162c8d94b5b843b5108ee1a9.tar.bz2 chat-72f61ab96aabf65c162c8d94b5b843b5108ee1a9.zip |
make cli team / channel delete operations also delete webhooks and slash commands (#7028)
Diffstat (limited to 'store/sql_command_store.go')
-rw-r--r-- | store/sql_command_store.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/store/sql_command_store.go b/store/sql_command_store.go index a80d1dbf4..6b2338380 100644 --- a/store/sql_command_store.go +++ b/store/sql_command_store.go @@ -134,6 +134,24 @@ func (s SqlCommandStore) Delete(commandId string, time int64) StoreChannel { return storeChannel } +func (s SqlCommandStore) PermanentDeleteByTeam(teamId string) StoreChannel { + storeChannel := make(StoreChannel, 1) + + go func() { + result := StoreResult{} + + _, err := s.GetMaster().Exec("DELETE FROM Commands WHERE TeamId = :TeamId", map[string]interface{}{"TeamId": teamId}) + if err != nil { + result.Err = model.NewLocAppError("SqlCommandStore.DeleteByTeam", "store.sql_command.save.delete_perm.app_error", nil, "id="+teamId+", err="+err.Error()) + } + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} + func (s SqlCommandStore) PermanentDeleteByUser(userId string) StoreChannel { storeChannel := make(StoreChannel, 1) |