Skip to content

Commit 4c1277b

Browse files
committed
Fix dropping STH by id
1 parent 82f13c6 commit 4c1277b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/cli/src/lib/commands/space.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,21 @@ export const space: CommandDefinition = (program) => {
8686
.argument("<space_name>", "The name of the Space")
8787
.option("--id <id>", "Hub Id")
8888
.option("--all", "Disconnects all self-hosted Hubs connected to Space", false)
89-
.action(async (spaceName: string, id: string, all: string) => {
89+
.action(async (spaceName: string, options: { id: string, all: boolean }) => {
9090
const mwClient = getMiddlewareClient();
9191
const managerClient = mwClient.getManagerClient(spaceName);
9292
let opts = { } as PostDisconnectPayload;
9393

94-
if (typeof id === "string") {
95-
opts = { id };
94+
if (typeof options.id === "string") {
95+
opts = { id: options.id };
9696
}
9797

98-
if (all) {
98+
if (options.all) {
9999
opts = { limit: 0 };
100100
}
101101

102+
console.dir({spaceName, opts}, { depth: 2 });
103+
102104
if (!Object.keys(opts).length) {
103105
throw new Error("Missing --id or --all");
104106
}

0 commit comments

Comments
 (0)