mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:41:15 +08:00
Can recover deleted topics. Deleted topics show the first post as deleted in the UI.
This commit is contained in:
@ -9,6 +9,7 @@ class TopicsController < ApplicationController
|
||||
:update,
|
||||
:star,
|
||||
:destroy,
|
||||
:recover,
|
||||
:status,
|
||||
:invite,
|
||||
:mute,
|
||||
@ -175,6 +176,13 @@ class TopicsController < ApplicationController
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
def recover
|
||||
topic = Topic.where(id: params[:topic_id]).with_deleted.first
|
||||
guardian.ensure_can_recover_topic!(topic)
|
||||
topic.recover!
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
def excerpt
|
||||
render nothing: true
|
||||
end
|
||||
|
Reference in New Issue
Block a user