Skip to content

Commit

Permalink
fix(containers): handle no-op scalingo
Browse files Browse the repository at this point in the history
  • Loading branch information
ksol committed Jul 16, 2021
1 parent d1f4625 commit 12026af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

## 0.3.11

* Containers: scaling can be a no-op (no operations return)

## 0.3.10

* Typo
Expand Down
11 changes: 8 additions & 3 deletions src/Containers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ export default class Containers {
"containers",
{ hasOperation: true }
);
const operation = new Operation(this._client, result.operation);
await operation.refresh();
return { formation: result.data, operation: operation };

if (result.operation) {
const operation = new Operation(this._client, result.operation);
await operation.refresh();
return { formation: result.data, operation: operation };
} else {
return { formation: result.data };
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/models/regional/containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface ContainersOperation {
/** Response of the API call */
formation: Container[];
/** Operation information */
operation: Operation;
operation?: Operation;
}

export interface Container {
Expand Down

0 comments on commit 12026af

Please sign in to comment.