courselab / pollex

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

Create poll list route #27

Closed ET33 closed 4 years ago

ET33 commented 4 years ago

We need a /polls route that responds all polls in which a user is participating. It's expected to receive a GET request along with the user token (in the request header) and return an array of polls.

GET - /polls
Request:
    header: {
        "token": string
    }

Response:
    {
        "polls": [
            {
                "poll_id": int,
                "name": string,
                "poll_owner": string,
                "votes_number": int,
                "total_votes": int,
                "created_date": date
            },
            ...
        ]
    }
andrefakhoury commented 4 years ago

As the database isn't ready yet, we made the response template, so that the front-end can be developed. (I think this issue can be closed now)

ET33 commented 4 years ago

Thanks!!