FEATURE: Add option to delete all replies of flagged post

This commit is contained in:
Gerhard Schlager
2018-04-24 11:08:05 -04:00
committed by Robin Ward
parent 035312d501
commit ed4c0c4a63
6 changed files with 108 additions and 15 deletions
+5
View File
@@ -259,6 +259,11 @@ class PostsController < ApplicationController
render json: post.reply_ids(guardian).to_json
end
def all_reply_ids
post = find_post_from_params
render json: post.reply_ids(guardian, only_replies_to_single_post: false).to_json
end
def destroy
post = find_post_from_params
RateLimiter.new(current_user, "delete_post", 3, 1.minute).performed! unless current_user.staff?