[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 удалений

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

@@ -2345,10 +2345,18 @@ func (a *App) PermanentDeleteChannel(channel *model.Channel) *model.AppError {
return model.NewAppError("PermanentDeleteChannel", "app.webhooks.permanent_delete_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
}
deleteAt := model.GetMillis()
if nErr := a.Srv().Store.Channel().PermanentDelete(channel.Id); nErr != nil {
return model.NewAppError("PermanentDeleteChannel", "app.channel.permanent_delete.app_error", nil, nErr.Error(), http.StatusInternalServerError)
}
a.invalidateCacheForChannel(channel)
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_DELETED, channel.TeamId, "", "", nil)
message.Add("channel_id", channel.Id)
message.Add("delete_at", deleteAt)
a.Publish(message)
return nil
}