Chore: Migrate REST API - joinRoom to Typescript (#3835)
* Chore: Migrate REST API - joinRoom to Typescript * join to discussion
This commit is contained in:
parent
637d69bb17
commit
4d6f21647e
|
@ -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 }) => {};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue