courselab / pollex

Open Source Online Poll Application
GNU General Public License v3.0
1 stars 9 forks source link

Create voting route #30

Closed ET33 closed 4 years ago

ET33 commented 4 years ago

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