diff --git a/app/definitions/rest/v1/channels.ts b/app/definitions/rest/v1/channels.ts index 8b14decb..88ae895c 100644 --- a/app/definitions/rest/v1/channels.ts +++ b/app/definitions/rest/v1/channels.ts @@ -52,6 +52,9 @@ export type ChannelsEndpoints = { 'channels.convertToTeam': { POST: (params: { channelId: string; channelName: string }) => { team: ITeam }; }; + 'channels.join': { + POST: (params: { roomId: string; joinCode: string | null }) => { channel: IServerRoomItem }; + }; 'channels.close': { POST: (params: { roomId: string }) => {}; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 728d30dd..59264a79 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -221,14 +221,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; } - // TODO: missing definitions from server - // @ts-ignore return sdk.post('channels.join', { roomId, joinCode }); };