Chore: Migrate REST API - createTeam to TS (#3788)

* Migrate `teams.create` REST API to TypeScript
This commit is contained in:
Gerzon Z 2022-03-02 16:17:42 -04:00 committed by GitHub
parent 529c9f0b00
commit 1da4f01dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,16 @@
import { IRoom } from '../../IRoom';
import { ITeam, TEAM_TYPE } from '../../ITeam';
export type TeamsEndpoints = {
'teams.removeRoom': {
POST: (params: { roomId: string; teamId: string }) => { room: IRoom };
};
'teams.create': {
POST: (params: {
name: string;
users: string[];
type: TEAM_TYPE;
room: { readOnly: boolean; extraData: { broadcast: boolean; encrypted: boolean } };
}) => { team: ITeam };
};
};

View File

@ -148,7 +148,7 @@ export const createTeam = ({
readOnly: boolean;
broadcast: boolean;
encrypted: boolean;
}): any => {
}) => {
const params = {
name,
users,
@ -162,8 +162,6 @@ export const createTeam = ({
}
};
// RC 3.13.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('teams.create', params);
};
export const addRoomsToTeam = ({ teamId, rooms }: { teamId: string; rooms: string[] }): any =>