Skip to content

Commit a471d47

Browse files
committed
feat: include label when asking user for an organization
1 parent a93a8a1 commit a471d47

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.changeset/lazy-lies-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smartthings/cli": patch
3+
---
4+
5+
include label as well as name when prompting user for an organization

packages/cli/src/lib/commands/organization-util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const chooseOrganization = async (
2020
itemName: 'organization',
2121
primaryKeyName: 'organizationId',
2222
sortKeyName: 'name',
23+
listTableFieldDefinitions: ['name', 'label', 'organizationId'],
2324
}
2425
const listItems = (): Promise<OrganizationResponse[]> => command.client.organizations.list()
2526
const preselectedId = opts.allowIndex

packages/cli/src/lib/commands/schema-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const organizationDef = (organizations: OrganizationResponse[]): InputDef
9999

100100
const choices = organizations
101101
.map(organization => ({
102-
name: organization.name,
102+
name: organization.label ? `${organization.name} (${organization.label})` : organization.name,
103103
value: organization.organizationId,
104104
}))
105105

0 commit comments

Comments
 (0)