Chore: Migrate REST API - leaveRoom to Typescript (#3833)

* chore: add rest api type

* remove any
This commit is contained in:
Gleidson Daniel Silva 2022-03-07 09:20:12 -03:00 committed by GitHub
parent 58418fc5c2
commit 892e919768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View File

@ -52,4 +52,7 @@ export type ChannelsEndpoints = {
'channels.convertToTeam': {
POST: (params: { channelId: string; channelName: string }) => { team: ITeam };
};
'channels.leave': {
POST: (params: { roomId: string }) => {};
};
};

View File

@ -46,4 +46,7 @@ export type GroupsEndpoints = {
'groups.convertToTeam': {
POST: (params: { roomId: string; roomName: string }) => { team: ITeam };
};
'groups.leave': {
POST: (params: { roomId: string }) => {};
};
};

View File

@ -38,4 +38,7 @@ export type ImEndpoints = {
messages: IMessageFromServer[];
};
};
'im.leave': {
POST: (params: { roomId: string }) => {};
};
};

View File

@ -428,10 +428,8 @@ export const toggleBlockUser = (rid: string, blocked: string, block: boolean): P
return sdk.methodCallWrapper('unblockUser', { rid, blocked });
};
export const leaveRoom = (roomId: string, t: RoomTypes): any =>
export const leaveRoom = (roomId: string, t: RoomTypes) =>
// RC 0.48.0
// TODO: missing definitions from server
// @ts-ignore
sdk.post(`${roomTypeToApiType(t)}.leave`, { roomId });
export const deleteRoom = (roomId: string, t: RoomTypes): any =>