Giter Site home page Giter Site logo

soen487-resoluteleopards's People

Contributors

dependabot[bot] avatar ghitier avatar peauc avatar theo-pnv avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

donnadonnam

soen487-resoluteleopards's Issues

[post_api] Delete post

route : /post/<post_id>

The route should return an error if the caller is not the author of the post

Get all posts with pagination

route

 /posts?page=1&posts_per_page=10&userid=42

This route should return posts_per_page number of posts with an offset of page * posts_per_page

params description
page the pagination number
posts_per_page number of posts per pages
userid id of the user to use for user_vote in response

returns

[
    {
        "id": "1",
        "title": "Wich one is nicer ?",
        "url_one": "https://cat.png",
        "url_two": "https://dog.png",
        "author_id" : 1,
        "author_name" : "Clem",
        "votes_one": 42,
        "votes_two": 445,
        "user_vote": -1 || 0 || 1
    }
]
field description
votes_one number of votes for the first picture (url_one)
votes_two number of votes for the second picture (url_two)
user_vote the vote of the user referenced in user_id in route parameters -1 if no vote 0 if first 1 if second

[post_api] Vote route

route

[POST] /vote

Create or Modify the vote for a post

body

[
    {
        "post_id": "1",
        "value": -1 || 0 || 1,
    }
]

header

[
    {
        "Authorization": "the_access_token"
    }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.