Chore: Migrate REST API - joinRoom to Typescript (#3835)

* Chore: Migrate REST API - joinRoom to Typescript

* join to discussion
This commit is contained in:
Reinaldo Neto 2022-03-07 13:07:40 -03:00 committed by GitHub
parent 637d69bb17
commit 4d6f21647e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -52,6 +52,9 @@ export type ChannelsEndpoints = {
'channels.convertToTeam': { 'channels.convertToTeam': {
POST: (params: { channelId: string; channelName: string }) => { team: ITeam }; POST: (params: { channelId: string; channelName: string }) => { team: ITeam };
}; };
'channels.join': {
POST: (params: { roomId: string; joinCode: string | null }) => { channel: IServerRoomItem };
};
'channels.close': { 'channels.close': {
POST: (params: { roomId: string }) => {}; POST: (params: { roomId: string }) => {};
}; };

View File

@ -221,14 +221,11 @@ export const convertTeamToChannel = ({ teamId, selected }: { teamId: string; sel
return sdk.post('teams.convertToChannel', params); return sdk.post('teams.convertToChannel', params);
}; };
export const joinRoom = (roomId: string, joinCode: string | null, type: 'c' | 'p'): any => { export const joinRoom = (roomId: string, joinCode: string | null, type: 'c' | 'p') => {
// TODO: join code
// RC 0.48.0 // RC 0.48.0
if (type === 'p') { if (type === 'p') {
return sdk.methodCallWrapper('joinRoom', roomId); return sdk.methodCallWrapper('joinRoom', roomId) as Promise<boolean>;
} }
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('channels.join', { roomId, joinCode }); return sdk.post('channels.join', { roomId, joinCode });
}; };