Skip to content

Commit

Permalink
Use automatic pagination mapping function
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed May 23, 2024
1 parent 1bea17f commit 898dead
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 6 additions & 1 deletion lib/api-client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/api-client.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ export async function listActionsCaches(
logger.debug(`Retrieving Actions caches for key ${key} and ref ${ref}`);

const apiClient = getApiClient();
return await apiClient.paginate(
"GET /repos/{owner}/{repo}/actions/caches",
{ owner: repositoryNwo.owner, repo: repositoryNwo.repo, key, ref },
(response) => response.data.actions_caches,
);
return await apiClient.paginate("GET /repos/{owner}/{repo}/actions/caches", {
owner: repositoryNwo.owner,
repo: repositoryNwo.repo,
key,
ref,
});
}

export function wrapApiConfigurationError(e: unknown) {
Expand Down

0 comments on commit 898dead

Please sign in to comment.