Skip to content

Commit

Permalink
Use fetchPagedListResult when listing Hyperdrive configs from API (#8012
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mtlemilio authored Feb 4, 2025
1 parent 6abe69c commit c412a31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/smooth-games-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

Use fetchPagedListResult when listing Hyperdrive configs from the API

This fixes an issue where only 20 configs were being listed.
11 changes: 7 additions & 4 deletions packages/wrangler/src/hyperdrive/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchResult } from "../cfetch";
import { fetchPagedListResult, fetchResult } from "../cfetch";
import { requireAuth } from "../user";
import type { Config } from "../config";

Expand Down Expand Up @@ -111,9 +111,12 @@ export async function getConfig(

export async function listConfigs(config: Config): Promise<HyperdriveConfig[]> {
const accountId = await requireAuth(config);
return await fetchResult(`/accounts/${accountId}/hyperdrive/configs`, {
method: "GET",
});
return await fetchPagedListResult(
`/accounts/${accountId}/hyperdrive/configs`,
{
method: "GET",
}
);
}

export async function patchConfig(
Expand Down

0 comments on commit c412a31

Please sign in to comment.