mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: log topic/post deletions from staff members
This commit is contained in:
@@ -167,7 +167,7 @@ class PostsController < ApplicationController
|
||||
|
||||
guardian.ensure_can_delete!(post)
|
||||
|
||||
destroyer = PostDestroyer.new(current_user, post)
|
||||
destroyer = PostDestroyer.new(current_user, post, { context: params[:context] })
|
||||
destroyer.destroy
|
||||
|
||||
render nothing: true
|
||||
|
||||
@@ -211,7 +211,7 @@ class TopicsController < ApplicationController
|
||||
guardian.ensure_can_delete!(topic)
|
||||
|
||||
first_post = topic.ordered_posts.first
|
||||
PostDestroyer.new(current_user, first_post).destroy
|
||||
PostDestroyer.new(current_user, first_post, { context: params[:context] }).destroy
|
||||
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user