diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-02-02 11:46:42 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-02-02 11:46:42 -0500 |
commit | 365514174ef00dcf426b2b5704c3d7adebe926e1 (patch) | |
tree | 41f5544aed1b822ae4e476c9ede496ce740d5048 /app/channel.go | |
parent | 60be5c902fe30c978d5b30f265509dc28c451407 (diff) | |
download | chat-365514174ef00dcf426b2b5704c3d7adebe926e1.tar.gz chat-365514174ef00dcf426b2b5704c3d7adebe926e1.tar.bz2 chat-365514174ef00dcf426b2b5704c3d7adebe926e1.zip |
Add tear down to APIv4 tests (#5250)
* Add tear down to APIv4 tests
* Defer tear downs
Diffstat (limited to 'app/channel.go')
-rw-r--r-- | app/channel.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/channel.go b/app/channel.go index 1f5d308bf..025eccfcd 100644 --- a/app/channel.go +++ b/app/channel.go @@ -866,3 +866,19 @@ func ViewChannel(view *model.ChannelView, teamId string, userId string, clearPus return nil } + +func PermanentDeleteChannel(channel *model.Channel) *model.AppError { + if result := <-Srv.Store.Post().PermanentDeleteByChannel(channel.Id); result.Err != nil { + return result.Err + } + + if result := <-Srv.Store.Channel().PermanentDeleteMembersByChannel(channel.Id); result.Err != nil { + return result.Err + } + + if result := <-Srv.Store.Channel().PermanentDelete(channel.Id); result.Err != nil { + return result.Err + } + + return nil +} |