Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #432, #437: Limit number of posts returned by HTTP /posts route #436

Merged
merged 8 commits into from Dec 4, 2019

Conversation

@manekenpix
Copy link
Collaborator

manekenpix commented Dec 4, 2019

GET /posts now accepts a query parameter to request a specific number of posts, with a max of 100 posts.
If no parameter is passed, it'll returned 30 posts.

For testing:

  • Run telescope npm start (with redis)
  • In a browser, go to:
    • localhost:3000/posts, the number of posts shown should be 30
    • localhost:3000/posts?counter=50, the number of posts shown should be 50
    • localhost:3000/posts?counter=200, the number of posts shown should be 100
@manekenpix manekenpix added this to In progress/Review in Main via automation Dec 4, 2019
Copy link
Contributor

humphd left a comment

You did this the same time as I was writing #432 (comment). Can you change the name to per_page and set the default to 30?

Otherwise, this is great.

@humphd humphd changed the title Closes #432: Limit number of posts returned by HTTP /posts route Closes #432, #437: Limit number of posts returned by HTTP /posts route Dec 4, 2019
@manekenpix manekenpix requested a review from humphd Dec 4, 2019
@manekenpix

This comment has been minimized.

Copy link
Collaborator Author

manekenpix commented Dec 4, 2019

@humphd sorry, just removed a magic number.

@manekenpix manekenpix requested a review from humphd Dec 4, 2019
@humphd
humphd approved these changes Dec 4, 2019
@cindyledev cindyledev merged commit 3458007 into Seneca-CDOT:master Dec 4, 2019
2 checks passed
2 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Main automation moved this from In progress/Review to Done Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.