Skip to content

Release v6.0.1: putPoll adds, removes and reorders options by id - #16

Merged
winrid merged 1 commit into
mainfrom
release-6.0.1
Sep 23, 2026
Merged

winrid merged 1 commit into
mainfrom
release-6.0.1

Conversation

@winrid

@winrid winrid commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

API changes

putPoll

  • The request body parameter is now commentPollPutInput: CommentPollPutInput (was commentPollInput: CommentPollInput).
  • CommentPollPutInput.options is CommentPollOptionInput[] ({id?: string | null, label: string}) instead of string[]:
    • an option with the id of an existing option keeps that option and its votes, taking the new label and position
    • an option without an id is added
    • existing options left out of the list are removed, along with the votes cast on them
  • replaceVotes is kept, and is now only required when the request keeps none of the existing option ids on a poll that has votes (error replace-votes-required).
  • New error codes: poll-privacy-locked (poll privacy can be narrowed but not widened once it has votes) and poll-conflict (the poll changed while saving; read it and retry).

getPollVotes / getPollVote

  • Now obey the poll's privacy: votes on an anonymous poll cannot be read and the request fails with poll-anonymous. Admins-only and public polls are readable with the API key.

New models

  • CommentPollPutInput
  • CommentPollOptionInput

CommentPollInput is unchanged and still used for creating a poll with a comment.

Notes

  • Existing putPoll callers must switch from commentPollInput with string options to commentPollPutInput with {label} objects (plus id to keep an option's votes).
  • Requires the matching FastComments server release; the server change is not deployed yet.

- 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).
@winrid
winrid merged commit d3b76c6 into main Sep 23, 2026
1 check passed
@winrid
winrid deleted the release-6.0.1 branch September 23, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant