diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-11-18 12:48:45 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-11-18 12:48:45 -0500 |
commit | e408d615c02ae3c863df3c7dc13d1b813c22fd28 (patch) | |
tree | a1c607b7721831c71aadbf89f018ed7b11a0e426 /store/sql_team_store.go | |
parent | 9660adb00775aba822d2d684d215c55679a456c6 (diff) | |
parent | c115191d6b5abdefda856c063e3f9048dc82f830 (diff) | |
download | chat-e408d615c02ae3c863df3c7dc13d1b813c22fd28.tar.gz chat-e408d615c02ae3c863df3c7dc13d1b813c22fd28.tar.bz2 chat-e408d615c02ae3c863df3c7dc13d1b813c22fd28.zip |
Merge pull request #1448 from mattermost/PLT-975
PLT-975 adding delete to command line tool
Diffstat (limited to 'store/sql_team_store.go')
-rw-r--r-- | store/sql_team_store.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/store/sql_team_store.go b/store/sql_team_store.go index 1a0aeabde..9578549ca 100644 --- a/store/sql_team_store.go +++ b/store/sql_team_store.go @@ -300,3 +300,20 @@ func (s SqlTeamStore) GetAllTeamListing() StoreChannel { return storeChannel } + +func (s SqlTeamStore) PermanentDelete(teamId string) StoreChannel { + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + + if _, err := s.GetMaster().Exec("DELETE FROM Teams WHERE Id = :TeamId", map[string]interface{}{"TeamId": teamId}); err != nil { + result.Err = model.NewAppError("SqlTeamStore.Delete", "We couldn't delete the existing team", "teamId="+teamId+", "+err.Error()) + } + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} |