Skip to content

Commit 2ae4b81

Browse files
authored
Add first reactions and user id support in filters (#134)
1 parent 172ae88 commit 2ae4b81

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

lib/stream/activities.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def get_activities(params = {})
4040
uri = params[:enrich] || params[:reactions] ? '/enrich/activities/' : '/activities/'
4141
if params[:reactions].respond_to?(:keys)
4242
params[:withOwnReactions] = true if params[:reactions][:own]
43+
params[:withFirstReactions] = true if params[:reactions][:first]
4344
params[:withRecentReactions] = true if params[:reactions][:recent]
4445
params[:withReactionCounts] = true if params[:reactions][:counts]
4546
params[:withOwnChildren] = true if params[:reactions][:children]

lib/stream/feed.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def get(params = {})
4242
params[:mark_seen] = params[:mark_seen].join(',') if params[:mark_seen]&.is_a?(Array)
4343
if params[:reactions].respond_to?(:keys)
4444
params[:withOwnReactions] = true if params[:reactions][:own]
45+
params[:withFirstReactions] = true if params[:reactions][:first]
4546
params[:withRecentReactions] = true if params[:reactions][:recent]
4647
params[:withReactionCounts] = true if params[:reactions][:counts]
4748
params[:withOwnChildren] = true if params[:reactions][:children]

lib/stream/reactions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def filter(params = {})
5757
field = 'user_id'
5858
value = params[:user_id]
5959
end
60-
params.delete(field.to_sym) unless field.empty?
60+
params.delete(field.to_sym) unless field.empty? && field != 'user_id'
6161
uri = if kind.nil? || kind.empty?
6262
"/reaction/#{field}/#{value}/"
6363
else

0 commit comments

Comments
 (0)