From 30acc1d81490a0d9c39a9a683c6a0be315e9e4bf Mon Sep 17 00:00:00 2001 From: Chima Precious Date: Wed, 4 Dec 2024 11:59:13 +0000 Subject: [PATCH] make token delete use scope --- .../lib/src/commands/token/token_delete_command.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/globe_cli/lib/src/commands/token/token_delete_command.dart b/packages/globe_cli/lib/src/commands/token/token_delete_command.dart index ccfde2d0..ce158930 100644 --- a/packages/globe_cli/lib/src/commands/token/token_delete_command.dart +++ b/packages/globe_cli/lib/src/commands/token/token_delete_command.dart @@ -4,7 +4,6 @@ import 'package:mason_logger/mason_logger.dart'; import '../../command.dart'; import '../../utils/api.dart'; -import '../../utils/prompts.dart'; class TokenDeleteCommand extends BaseGlobeCommand { TokenDeleteCommand() { @@ -23,8 +22,8 @@ class TokenDeleteCommand extends BaseGlobeCommand { @override FutureOr run() async { requireAuth(); + await scope.selectOrLinkNewScope(); - final organization = await selectOrganization(logger: logger, api: api); final tokenId = (argResults?['tokenId'] as String?) ?? logger.prompt('❓ Provide id for token:'); @@ -32,10 +31,7 @@ class TokenDeleteCommand extends BaseGlobeCommand { logger.progress('Deleting Token: ${cyan.wrap(tokenId)}'); try { - await api.deleteToken( - orgId: organization.id, - tokenId: tokenId, - ); + await api.deleteToken(orgId: scope.current!.orgId, tokenId: tokenId); deleteTokenProgress.complete('Token deleted'); } on ApiException catch (e) { deleteTokenProgress.fail('✗ Failed to delete token: ${e.message}');