-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
FEATURE: Allow users to remove their vote #14459
Conversation
They can use the remove vote button or select the same option again for single choice polls.
a0fefc4
to
c376eda
Compare
This pull request has been mentioned on Discourse Meta. There might be relevant details there: |
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.
@nbianca I really like the refactor that you did here. Things are properly organised and alot easier to follow.
|
||
begin | ||
poll, options = DiscoursePoll::Poll.vote(post_id, poll_name, options, current_user) | ||
render json: { poll: poll, vote: options } |
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.
Why is vote
called options
? 🤔
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 am not sure exactly why, but this is the name in JavaScript too. It makes sense because a vote is nothing more than a set of selected poll options.
They can use the remove vote button or select the same option again for
single choice polls.