make cli team / channel delete operations also delete webhooks and slash commands (#7028)

Этот коммит содержится в:
Chris
2017-07-31 08:52:45 -07:00
коммит произвёл Harrison Healey
родитель 0f786a42d3
Коммит 72f61ab96a
10 изменённых файлов: 275 добавлений и 4 удалений

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

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