From 1ef9f57f3dc6eccd3f8720ec6e7d3ca6afaff7aa Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Mon, 7 Mar 2022 09:57:57 -0300 Subject: [PATCH] Chore: Migrate REST API - hideRoom to Typescript (#3832) --- app/definitions/rest/v1/channels.ts | 3 +++ app/definitions/rest/v1/groups.ts | 3 +++ app/definitions/rest/v1/im.ts | 3 +++ app/lib/rocketchat/services/restApi.ts | 4 +--- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/definitions/rest/v1/channels.ts b/app/definitions/rest/v1/channels.ts index e00ba347..071734b1 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.close': { + POST: (params: { roomId: string }) => {}; + }; 'channels.kick': { POST: (params: { roomId: string; userId: string }) => {}; }; diff --git a/app/definitions/rest/v1/groups.ts b/app/definitions/rest/v1/groups.ts index daf95517..80de882a 100644 --- a/app/definitions/rest/v1/groups.ts +++ b/app/definitions/rest/v1/groups.ts @@ -46,6 +46,9 @@ export type GroupsEndpoints = { 'groups.convertToTeam': { POST: (params: { roomId: string; roomName: string }) => { team: ITeam }; }; + 'groups.close': { + POST: (params: { roomId: string }) => {}; + }; 'groups.kick': { POST: (params: { roomId: string; userId: string }) => {}; }; diff --git a/app/definitions/rest/v1/im.ts b/app/definitions/rest/v1/im.ts index 8888f0ba..cdd46bd1 100644 --- a/app/definitions/rest/v1/im.ts +++ b/app/definitions/rest/v1/im.ts @@ -38,6 +38,9 @@ export type ImEndpoints = { messages: IMessageFromServer[]; }; }; + 'im.close': { + POST: (params: { roomId: string }) => {}; + }; 'im.kick': { POST: (params: { roomId: string; userId: string }) => {}; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 7dcfc086..71a0e783 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -534,10 +534,8 @@ export const toggleArchiveRoom = (roomId: string, t: SubscriptionType, archive: return sdk.post(`${roomTypeToApiType(type)}.unarchive`, { roomId }); }; -export const hideRoom = (roomId: string, t: RoomTypes): any => +export const hideRoom = (roomId: string, t: RoomTypes) => // RC 0.48.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post(`${roomTypeToApiType(t)}.close`, { roomId }); export const saveRoomSettings = (