Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4771,6 +4771,29 @@ paths:
$ref: '#/components/responses/PollNotFoundError'
'500':
$ref: '#/components/responses/UnexpectedError'
put:
summary: update poll votes
tags:
- Poll
security:
- BearerAuth: []
description: |
Update poll answers.
parameters:
- $ref: '#/components/parameters/pollId'
- $ref: '#/components/parameters/authorization'
- $ref: '#/components/parameters/content-type'
requestBody:
$ref: '#/components/requestBodies/_pollId-votes-put-request-payload'
responses:
'200':
$ref: '#/components/responses/response_common-response-200-6'
'400':
$ref: '#/components/responses/BadRequestError'
'404':
$ref: '#/components/responses/PollNotFoundError'
'500':
$ref: '#/components/responses/UnexpectedError'
/api/v3/polls/{pollId}/answers/{answerId}:
get:
summary: List users who vote the poll with specific answer
Expand Down Expand Up @@ -22886,7 +22909,23 @@ components:
type: object
properties:
answerIds:
description: poll id
type: array
items:
type: string
required:
- data
_pollId-votes-put-request-payload:
description: |
The desired poll answers to be updated.
The invalid answer id will be ignored.
If answerIds is empty, meaning that the user unvote all answers.
required: true
content:
application/json:
schema:
type: object
properties:
answerIds:
type: array
items:
type: string
Expand Down
23 changes: 23 additions & 0 deletions v3/poll/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,29 @@ _pollId-votes:
500:
$ref: "../../global/error.yaml#/UnexpectedError"

put:
summary: "update poll votes"
tags:
- "Poll"
security:
- BearerAuth: []
description: "Update poll answers"
parameters:
- $ref: "./parameter.yaml#/pollId"
- $ref: "./parameter.yaml#/authorization"
- $ref: "./parameter.yaml#/content-type"
requestBody:
$ref: "./request.yaml#/_pollId-votes-put-request-payload"
responses:
200:
$ref: "./response.yaml#/common-response-200"
400:
$ref: "../../global/error.yaml#/BadRequestError"
404:
$ref: "../../global/error.yaml#/PollNotFoundError"
500:
$ref: "../../global/error.yaml#/UnexpectedError"

_pollId-answers_answerId:
get:
summary: "List users who vote the poll with specific answer"
Expand Down
16 changes: 15 additions & 1 deletion v3/poll/request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,21 @@ _pollId-votes-post-request-payload:
type: "object"
properties:
answerIds:
description: "poll id"
type: "array"
items:
type: "string"
required:
- "data"

_pollId-votes-put-request-payload:
description: "Information of poll answers to be updated.\nThe invalid answer ids will be ignored.\nIf answerIds is empty, meaning that the user unvote all answers."
required: true
content:
application/json:
schema:
type: "object"
properties:
answerIds:
type: "array"
items:
type: "string"
Expand Down
Loading