Add missing argument for reaction notification (#1901)
This commit is contained in:
parent
d9e1ab2caa
commit
1fc33cdd10
1 changed files with 6 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ module Api
|
|||
reactable_type: params[:reactable_type],
|
||||
category: params[:category] || "like",
|
||||
)
|
||||
Notification.send_reaction_notification(@reaction)
|
||||
Notification.send_reaction_notification(@reaction, @reaction.reactable.user)
|
||||
Notification.send_reaction_notification(@reaction, @reaction.reactable.organization) if organization_article?(@reaction)
|
||||
render json: { reaction: @reaction.to_json }
|
||||
end
|
||||
|
||||
|
|
@ -39,6 +40,10 @@ module Api
|
|||
user = nil if !user.has_role?(:super_admin)
|
||||
user
|
||||
end
|
||||
|
||||
def organization_article?(reaction)
|
||||
reaction.reactable_type == "Article" && reaction.reactable.organization_id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue