github-label-manager
github-label-manager copied to clipboard
Only gets first page of labels (during copy, list, etc)
Description
The API call on this line: https://github.com/destan/github-label-manager/blob/1a6a832522e45e31964e150142f3a07490dcc76a/js/app.js#L82
only gets the first page of labels. Per the API docs, you can use ?page=2
to get the second page etc.
Reproduction
You can see an example of this in some of my repos, e.g.:
- https://api.github.com/repos/agilgur5/react-signature-canvas/labels
- https://api.github.com/repos/agilgur5/react-signature-canvas/labels?page=2
Solutions
Per the docs, the link
header can be parsed to get the next (or previous) page as well as the last page. Though a simpler method may be to just try a new page until the response is an empty array []
, which would also indicate there are no more pages
For anyone interested, this commit on my fork adds multi-page label support