Skip to content

Commit

Permalink
Merge pull request #230 from internxt/feature/PB-2407-team-details
Browse files Browse the repository at this point in the history
[PB-2407] feature/edit get team members endpoint
  • Loading branch information
rafijv authored Aug 2, 2024
2 parents e98df1b + 432678a commit e847292
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internxt/sdk",
"version": "1.5.5",
"version": "1.5.6",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
5 changes: 2 additions & 3 deletions src/workspaces/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,13 @@ describe('Workspaces service tests', () => {

describe('getWorkspacesTeamMembers', () => {
it('should return the members of a team when getWorkspacesTeamMembers is called', async () => {
const workspaceId = 'workspaceId';
const teamId = 'teamId';
const { client, headers } = clientAndHeaders();
const getCall = sinon.stub(httpClient, 'get').resolves();

await client.getWorkspacesTeamMembers(workspaceId, teamId);
await client.getWorkspacesTeamMembers(teamId);

expect(getCall.firstCall.args).toEqual([`workspaces/${workspaceId}/teams/${teamId}/members`, headers]);
expect(getCall.firstCall.args).toEqual([`workspaces/teams/${teamId}/members`, headers]);
});
});

Expand Down
5 changes: 3 additions & 2 deletions src/workspaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
WorkspaceSetupInfo,
WorkspacesResponse,
WorkspaceTeamResponse,
TeamMembers,
} from './types';

export class Workspaces {
Expand Down Expand Up @@ -173,8 +174,8 @@ export class Workspaces {
return this.client.delete<void>(`workspaces/teams/${teamId}`, this.headers());
}

public getWorkspacesTeamMembers(workspaceId: string, teamId: string): Promise<void> {
return this.client.get<void>(`workspaces/${workspaceId}/teams/${teamId}/members`, this.headers());
public getWorkspacesTeamMembers(teamId: string): Promise<TeamMembers> {
return this.client.get<TeamMembers>(`workspaces/teams/${teamId}/members`, this.headers());
}

public addTeamUser(teamId: string, userUuid: string): Promise<void> {
Expand Down
9 changes: 9 additions & 0 deletions src/workspaces/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ export type WorkspaceMembers = {
disabledUsers: WorkspaceUser[];
};

export type TeamMembers = {
name: string;
lastname: string;
email: string;
id: number;
uuid: string;
avatar: string | null;
}[];

export type Member = {
avatar: string | null;
backupsBucket: string | null;
Expand Down

0 comments on commit e847292

Please sign in to comment.