Repository navigation
Release v6.0.1: putPoll adds, removes and reorders options by id - #16
Merged
Merged
Conversation
- putPoll takes commentPollPutInput (CommentPollPutInput) instead of commentPollInput.
Its options are CommentPollOptionInput objects ({id?, label}) rather than strings:
an option with an existing id keeps its votes, one without an id is added, and
existing options left out are removed with their votes.
- replaceVotes is now only required when no existing option ids are kept on a poll
that has votes.
- New models: CommentPollPutInput, CommentPollOptionInput.
- getPollVotes and getPollVote refuse anonymous polls (poll-anonymous).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API changes
putPollcommentPollPutInput: CommentPollPutInput(wascommentPollInput: CommentPollInput).CommentPollPutInput.optionsisCommentPollOptionInput[]({id?: string | null, label: string}) instead ofstring[]:idof an existing option keeps that option and its votes, taking the new label and positionidis addedreplaceVotesis kept, and is now only required when the request keeps none of the existing option ids on a poll that has votes (errorreplace-votes-required).poll-privacy-locked(poll privacy can be narrowed but not widened once it has votes) andpoll-conflict(the poll changed while saving; read it and retry).getPollVotes/getPollVotepoll-anonymous. Admins-only and public polls are readable with the API key.New models
CommentPollPutInputCommentPollOptionInputCommentPollInputis unchanged and still used for creating a poll with a comment.Notes
putPollcallers must switch fromcommentPollInputwith string options tocommentPollPutInputwith{label}objects (plusidto keep an option's votes).