-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add like and reshare services #7337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes.
{positive: 1, post_id: @target.id} | ||
} | ||
let(:dislike_hash) { | ||
{positive: 0, post_id: @target.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just drop this dislike
stuff (also positive
on like_hash
), because it is not used anywhere.
@reshare = current_user.build_post(:reshare, :root_guid => params[:root_guid]) | ||
end | ||
post = Post.where(guid: params[:root_guid]).first | ||
root_guid = (post.is_a? Reshare) ? post.absolute_root.guid : params[:root_guid] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do that in the service, not in the controller.
a7f45a3
to
3725b4d
Compare
3725b4d
to
cddab66
Compare
No description provided.