refactor: use the new github.paginate syntax

This commit is contained in:
Gregor 2019-01-08 00:25:31 -08:00
parent 6dc8dccdf8
commit 624bae2d61
1 changed files with 2 additions and 4 deletions

View File

@ -39,8 +39,7 @@ export = async (app: Application): Promise<void> => {
async function getInstallations (): Promise<Installation[]> {
const github = await app.auth()
const req = github.apps.listInstallations({ per_page: 100 })
return github.paginate(req, (response: AnyResponse) => {
return github.paginate(github.apps.listInstallations.endpoint.merge({ per_page: 100 }), (response: AnyResponse) => {
return response.data
})
}
@ -57,8 +56,7 @@ export = async (app: Application): Promise<void> => {
const github = await app.auth(installation.id)
const req = github.apps.listRepos({ per_page: 100 })
const repositories: Repository[] = await github.paginate(req, (response: AnyResponse) => {
const repositories: Repository[] = await github.paginate(github.apps.listRepos.endpoint.merge({ per_page: 100 }), (response: AnyResponse) => {
return response.data.repositories.filter((repository: Repository) => !repository.private)
})