From 365514174ef00dcf426b2b5704c3d7adebe926e1 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 2 Feb 2017 11:46:42 -0500 Subject: Add tear down to APIv4 tests (#5250) * Add tear down to APIv4 tests * Defer tear downs --- app/channel.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/channel.go') 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 +} -- cgit v1.2.3-1-g7c22