paging for flag list

corrected reload behavior on flag list
refactored post actions ... extracted flag queries
This commit is contained in:
Sam
2013-08-19 21:14:26 +10:00
parent 22bcb7d412
commit a9393e4a7a
14 changed files with 261 additions and 216 deletions
+3 -1
View File
@@ -1,8 +1,10 @@
require 'flag_query'
class Admin::FlagsController < Admin::AdminController
def index
# we may get out of sync, fix it here
PostAction.update_flagged_posts_count
posts, users = PostAction.flagged_posts_report(params[:filter])
posts, users = FlagQuery.flagged_posts_report(params[:filter], params[:offset].to_i, 10)
if posts.blank?
render json: {users: [], posts: []}