GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — Add pagination to search endpoints by alaycock · Pull Request #583 · github-tools/github Conversation
|
| /** | ||
| * Create a new Search wrapper | ||
| * @param {string} query - the query to search for | ||
| * @param {Search.Params} searchParameters - the query and other search parameters |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not sure if jsdoc understands how to reach into other files (Search.js). Let me know if this will be a problem.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (!options) { | ||
| options = {}; | ||
| } | ||
| options.page = parseInt( |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If someone can clarify this, I would appreciate it.
Why does the page number need to be manually extracted and appended to the options?
nextUrl is being extracted from the headers, wouldn't it have all the options it already needs? Then by calling this._requestAllPages(nextUrl, options, cb, results); the options are being re-added to the url, which results in duplicate parameters in the path, eg:
/search/repositories?q=tetris+language%3Aassembly&sort=stars&order=desc&type=all&per_page=100&page=4&q=tetris+language:assembly&sort=stars&order=desc&type=all&per_page=100&page=4
Although this might just be a workaround for other endpoints, since I have't done exploration into how other endpoints paginate.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Feature Request] Ability to fetch a single page of items in a list
There was an error while loading. Please reload this page.