Skip to content

Commit

Permalink
Fix res.body.connectors is not iterable error on deploy --only dataco…
Browse files Browse the repository at this point in the history
…nnect (#7353)
  • Loading branch information
joehan authored Jun 21, 2024
1 parent 0975e74 commit e1a81f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixes issue where `deploy --only dataconnect` would error out with `cannot read property undefined`.
6 changes: 3 additions & 3 deletions src/dataconnect/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ export async function listConnectors(serviceName: string) {
const connectors: types.Connector[] = [];
const getNextPage = async (pageToken = "") => {
const res = await dataconnectClient().get<{
connectors: types.Connector[];
nextPageToken: string;
connectors?: types.Connector[];
nextPageToken?: string;
}>(`${serviceName}/connectors`, {
queryParams: {
pageSize: PAGE_SIZE_MAX,
pageToken,
},
});
connectors.push(...res.body.connectors);
connectors.push(...(res.body.connectors || []));
if (res.body.nextPageToken) {
await getNextPage(res.body.nextPageToken);
}
Expand Down

0 comments on commit e1a81f8

Please sign in to comment.