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

onPage should start at 1 #1

Open
rgroves opened this issue Mar 19, 2020 · 1 comment
Open

onPage should start at 1 #1

rgroves opened this issue Mar 19, 2020 · 1 comment

Comments

@rgroves
Copy link

rgroves commented Mar 19, 2020

let resultCount = 1, onPage = 0;

If onPage starts at 0 the results are duplicate between the call with page=0 and page=1. There will be 50 duplicates in your data store.

If you compare the results of these example calls you'll see that is the case:
https://jobs.github.com/positions.json?description=ruby&page=0
https://jobs.github.com/positions.json?description=ruby&page=1

Probably not critical for this tutorial sample app, but pointing it out for good measure. 🙂

It's a small change to make, but if you'd like a PR let me know.

@join2akshay
Copy link

yes, I simply changed onPage=0 to onPage=1. It removed duplicate elements from allJobs

let resultCount = 1, onPage = 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants