mirror of
https://github.com/discourse/discourse.git
synced 2025-06-24 01:41:35 +08:00
Can refresh queued posts via button
This commit is contained in:
@ -224,7 +224,14 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
def render_json_dump(obj, opts=nil)
|
||||
opts ||= {}
|
||||
obj['__rest_serializer'] = "1" if opts[:rest_serializer]
|
||||
if opts[:rest_serializer]
|
||||
obj['__rest_serializer'] = "1"
|
||||
opts.each do |k, v|
|
||||
obj[k] = v if k.to_s.start_with?("refresh_")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
render json: MultiJson.dump(obj), status: opts[:status] || 200
|
||||
end
|
||||
|
||||
|
@ -9,7 +9,12 @@ class QueuedPostsController < ApplicationController
|
||||
state ||= QueuedPost.states[:new]
|
||||
|
||||
@queued_posts = QueuedPost.visible.where(state: state).includes(:topic, :user)
|
||||
render_serialized(@queued_posts, QueuedPostSerializer, root: :queued_posts, rest_serializer: true)
|
||||
render_serialized(@queued_posts,
|
||||
QueuedPostSerializer,
|
||||
root: :queued_posts,
|
||||
rest_serializer: true,
|
||||
refresh_queued_posts: "/queued_posts?status=new")
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
|
Reference in New Issue
Block a user