Chore: Migrate REST API - createTeam to TS (#3788)
* Migrate `teams.create` REST API to TypeScript
This commit is contained in:
parent
529c9f0b00
commit
1da4f01dcb
|
@ -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 };
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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 =>
|
||||
|
|
Loading…
Reference in New Issue