@@ -11,7 +11,7 @@ class GitHubAPIService(
1111) {
1212
1313 companion object {
14- private const val PER_PAGE = 30 // Maximum allowed by GitHub API is 100
14+ private const val PAGE_SIZE = 30 // Maximum allowed by GitHub API is 100
1515 }
1616
1717 fun getPaginatedInstallations (jwtToken : String ): List <Installation > {
@@ -20,10 +20,10 @@ class GitHubAPIService(
2020 var currentInstallations: List <Installation >
2121
2222 do {
23- currentInstallations = gitHubClient.getInstallations(" Bearer $jwtToken " , PER_PAGE , page)
23+ currentInstallations = gitHubClient.getInstallations(" Bearer $jwtToken " , PAGE_SIZE , page)
2424 if (currentInstallations.isNotEmpty()) installations.addAll(currentInstallations) else break
2525 page++
26- } while (currentInstallations.size == PER_PAGE )
26+ } while (currentInstallations.size == PAGE_SIZE )
2727 return installations
2828 }
2929
@@ -33,10 +33,10 @@ class GitHubAPIService(
3333 var currentOrganizations: List <Organization >
3434
3535 do {
36- currentOrganizations = gitHubClient.getOrganizations(" Bearer $installationToken " , PER_PAGE , since)
36+ currentOrganizations = gitHubClient.getOrganizations(" Bearer $installationToken " , PAGE_SIZE , since)
3737 if (currentOrganizations.isNotEmpty()) organizations.addAll(currentOrganizations) else break
3838 since = currentOrganizations.last().id
39- } while (currentOrganizations.size == PER_PAGE )
39+ } while (currentOrganizations.size == PAGE_SIZE )
4040 return organizations
4141 }
4242}
0 commit comments