We need a /polls/:poll_id/vote route that will register a vote from the current user.
It's expected to receive a POST request along with the user token (in the request header) and the option chosen to be voted and respond with a status code depending on the outcome.
POST - /polls/:poll_id/vote
Request:
header: {
"token": string
}
body: {
"option": int
}
Response:
Status Ok or Error
We need a
/polls/:poll_id/vote
route that will register a vote from the current user.It's expected to receive a POST request along with the user token (in the request header) and the option chosen to be voted and respond with a status code depending on the outcome.