From 0a20e8d3269515e2d44a0bcad0a2408f62245814 Mon Sep 17 00:00:00 2001 From: Robin Naundorf Date: Mon, 15 May 2017 22:12:30 +0200 Subject: PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263) --- app/channel.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/channel.go') diff --git a/app/channel.go b/app/channel.go index 4164b37ce..bd9acaa6d 100644 --- a/app/channel.go +++ b/app/channel.go @@ -285,6 +285,14 @@ func UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { } } +func RestoreChannel(channel *model.Channel) (*model.Channel, *model.AppError) { + if result := <-Srv.Store.Channel().Restore(channel.Id, model.GetMillis()); result.Err != nil { + return nil, result.Err + } else { + return channel, nil + } +} + func PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userId string) (*model.Channel, *model.AppError) { oldChannelDisplayName := channel.DisplayName oldChannelHeader := channel.Header -- cgit v1.2.3-1-g7c22