Skip to content

Commit

Permalink
feat: add getGroups(withTree?: boolean) API
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Apr 21, 2024
1 parent 8293204 commit 02c17eb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,18 @@ export class GroupSDK {
this.request = request
}

public async getGroups() {
public async getGroups(withTree?: boolean) {
if (!this.request) {
throw new Error('request init failed')
}

const params: any = { owner: this.config.orgName }
if (withTree) {
params.withTree = 'true'
}

return (await this.request.get('/get-groups', {
params: {
owner: this.config.orgName,
},
params,
})) as unknown as Promise<AxiosResponse<{ data: Group[] }>>
}

Expand Down

0 comments on commit 02c17eb

Please sign in to comment.