Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(manager): specify a higher per_page for DigitalOcean API call #1113

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/server_manager/cloud/digitalocean_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,19 @@ export class RestApiSession implements DigitalOceanSession {

public getDropletsByTag(tag: string): Promise<DropletInfo[]> {
console.info('Requesting droplet by tag');
// TODO Add proper pagination support. Going with 100 for now to extend the default of 20, and confirm UI works
return this.request<{droplets: DropletInfo[]}>(
'GET',
cgarvey marked this conversation as resolved.
Show resolved Hide resolved
`droplets?tag_name=${encodeURI(tag)}`
`droplets?per_page=100&tag_name=${encodeURI(tag)}`
cgarvey marked this conversation as resolved.
Show resolved Hide resolved
).then((response) => {
return response.droplets;
});
}

public getDroplets(): Promise<DropletInfo[]> {
console.info('Requesting droplets');
return this.request<{droplets: DropletInfo[]}>('GET', 'droplets').then((response) => {
// TODO Add proper pagination support. Going with 100 for now to extend the default of 20, and confirm UI works
return this.request<{droplets: DropletInfo[]}>('GET', 'droplets?per_page=100').then((response) => {
return response.droplets;
});
}
Expand Down