FIX: disagree flag should unhide hidden post

This commit is contained in:
Régis Hanol
2014-08-11 10:48:00 +02:00
parent f897c89d48
commit e64d3b8a42
7 changed files with 27 additions and 23 deletions

View File

@@ -44,7 +44,6 @@ class Admin::FlagsController < Admin::AdminController
PostAction.clear_flags!(post, current_user)
post.reload
post.unhide!
render nothing: true

View File

@@ -50,14 +50,8 @@ class PostActionsController < ApplicationController
guardian.ensure_can_defer_flags!(@post)
PostAction.defer_flags!(@post, current_user)
@post.reload
if @post.is_flagged?
render json: { success: true, hidden: true }
else
@post.unhide!
render json: { success: true, hidden: false }
end
render json: { success: true }
end
private