We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b499bd6 commit 920b38cCopy full SHA for 920b38c
src/commands/ci/fetch-default-org-slug.mts
@@ -30,18 +30,18 @@ export async function getDefaultOrgSlug(): Promise<CResult<string>> {
30
return result
31
}
32
33
- const orgs = result.data.organizations
34
- const keys = Object.keys(orgs)
+ const { organizations } = result.data
+ const keys = Object.keys(organizations)
35
36
- if (!keys[0]) {
+ if (!keys.length) {
37
return {
38
ok: false,
39
message: 'Failed to establish identity',
40
data: `API did not return any organization associated with the current API token. Unable to continue.`,
41
42
43
44
- const slug = (keys[0] in orgs && orgs?.[keys[0]]?.name) ?? undefined
+ const slug = (organizations as any)[keys[0]!]?.name ?? undefined
45
46
if (!slug) {
47
0 commit comments