Skip to content
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

Merged
merged 6 commits into from
Oct 5, 2021
Merged

FEATURE: Allow users to remove their vote #14459

merged 6 commits into from
Oct 5, 2021

Conversation

nbianca
Copy link
Member

@nbianca nbianca commented Sep 28, 2021

They can use the remove vote button or select the same option again for
single choice polls.

They can use the remove vote button or select the same option again for
single choice polls.
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/unvote-a-poll/50476/13

plugins/poll/plugin.rb Outdated Show resolved Hide resolved
plugins/poll/plugin.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@tgxworld tgxworld left a 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.

@tgxworld tgxworld added the 👍 OP to merge PR author can go ahead and merge! label Sep 30, 2021

begin
poll, options = DiscoursePoll::Poll.vote(post_id, poll_name, options, current_user)
render json: { poll: poll, vote: options }
Copy link
Member

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? 🤔

Copy link
Member Author

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.

@nbianca nbianca merged commit 6a14303 into main Oct 5, 2021
@nbianca nbianca deleted the feature_poll_unvote branch October 5, 2021 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 OP to merge PR author can go ahead and merge!
Development

Successfully merging this pull request may close these issues.

4 participants