[MM-25659] ability to permanent delete channel through client (#15202)

Summary

    Ability to permanent delete channel through client

Ticket Link

    https://mattermost.atlassian.net/browse/MM-25659
Этот коммит содержится в:
Ashish Bhate
2020-08-14 08:42:39 +00:00
коммит произвёл GitHub
родитель 11513a8d0d
Коммит d76039db23
7 изменённых файлов: 113 добавлений и 2 удалений

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

@@ -1074,7 +1074,15 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
err = c.App.DeleteChannel(channel, c.App.Session().UserId)
if c.Params.Permanent {
if *c.App.Config().ServiceSettings.EnableAPIChannelDeletion {
err = c.App.PermanentDeleteChannel(channel)
} else {
err = model.NewAppError("deleteChannel", "api.user.delete_channel.not_enabled.app_error", nil, "channelId="+c.Params.ChannelId, http.StatusUnauthorized)
}
} else {
err = c.App.DeleteChannel(channel, c.App.Session().UserId)
}
if err != nil {
c.Err = err
return