Add missing argument for reaction notification (#1901)

This commit is contained in:
Andy Zhao 2019-02-26 09:14:31 -05:00 committed by Mac Siri
parent d9e1ab2caa
commit 1fc33cdd10

View file

@ -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