mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Simplify user action make it more idiomatic
This commit is contained in:
@@ -14,12 +14,15 @@ class UserActionsController < ApplicationController
|
||||
ignore_private_messages: params[:filter] ? false : true
|
||||
}
|
||||
|
||||
if opts[:action_types] == [UserAction::GOT_PRIVATE_MESSAGE] ||
|
||||
opts[:action_types] == [UserAction::NEW_PRIVATE_MESSAGE]
|
||||
render json: UserAction.private_message_stream(opts[:action_types][0], opts)
|
||||
else
|
||||
render json: UserAction.stream(opts)
|
||||
end
|
||||
stream =
|
||||
if opts[:action_types] == [UserAction::GOT_PRIVATE_MESSAGE] ||
|
||||
opts[:action_types] == [UserAction::NEW_PRIVATE_MESSAGE]
|
||||
UserAction.private_message_stream(opts[:action_types][0], opts)
|
||||
else
|
||||
UserAction.stream(opts)
|
||||
end
|
||||
|
||||
render_serialized(stream, UserActionSerializer, root: "user_actions")
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user