Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/definitions/rest/v1/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ export type ChannelsEndpoints = {
'channels.convertToTeam': {
POST: (params: { channelId: string; channelName: string }) => { team: ITeam };
};
'channels.join': {
POST: (params: { roomId: string; joinCode: string | null }) => { channel: IServerRoomItem };
};
};
7 changes: 2 additions & 5 deletions app/lib/rocketchat/services/restApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,11 @@ export const convertTeamToChannel = ({ teamId, selected }: { teamId: string; sel
return sdk.post('teams.convertToChannel', params);
};

export const joinRoom = (roomId: string, joinCode: string | null, type: 'c' | 'p'): any => {
// TODO: join code
export const joinRoom = (roomId: string, joinCode: string | null, type: 'c' | 'p') => {
// RC 0.48.0
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 });
};

Expand Down