courselab / pollex

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

Create update poll route #28

Closed ET33 closed 4 years ago

ET33 commented 4 years ago

We need a /polls/:poll_id route that update a poll with new data.

It's expected to receive a PATCH request along with the user token (in the request header) and all attributes that will be changed, then respond with a status code depending on the outcome.

PATCH - /polls/:poll_id
Request:
    header: {
        "token": string
    }
    body: {
        "attr1": new_value,
        "attr2": new_value,
        ...
    }

Response:
    Status Ok or Error