mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Users can see their pending posts
This commit is contained in:
@@ -8,16 +8,23 @@ class UserActionsController < ApplicationController
|
||||
|
||||
user = fetch_user_from_params
|
||||
|
||||
opts = {
|
||||
user_id: user.id,
|
||||
offset: params[:offset].to_i,
|
||||
limit: per_chunk,
|
||||
action_types: (params[:filter] || "").split(",").map(&:to_i),
|
||||
guardian: guardian,
|
||||
ignore_private_messages: params[:filter] ? false : true
|
||||
}
|
||||
opts = { user_id: user.id,
|
||||
user: user,
|
||||
offset: params[:offset].to_i,
|
||||
limit: per_chunk,
|
||||
action_types: (params[:filter] || "").split(",").map(&:to_i),
|
||||
guardian: guardian,
|
||||
ignore_private_messages: params[:filter] ? false : true }
|
||||
|
||||
render_serialized(UserAction.stream(opts), UserActionSerializer, root: "user_actions")
|
||||
# Pending is restricted
|
||||
stream = if opts[:action_types].include?(UserAction::PENDING)
|
||||
guardian.ensure_can_see_notifications!(user)
|
||||
UserAction.stream_queued(opts)
|
||||
else
|
||||
UserAction.stream(opts)
|
||||
end
|
||||
|
||||
render_serialized(stream, UserActionSerializer, root: "user_actions")
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user