From d7c46a27d01ec2a6016574649f11cd042a3711c7 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 8 Mar 2022 09:46:33 -0400 Subject: [PATCH] Chore: Migrate REST API - getChannelInfo to TS (#3839) * add: type for REST API `channels.info` * add: `ts-ignore` to `RoomActionsView` --- app/definitions/rest/v1/channels.ts | 3 +++ app/lib/rocketchat/services/restApi.ts | 4 +--- app/views/RoomActionsView/index.tsx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/definitions/rest/v1/channels.ts b/app/definitions/rest/v1/channels.ts index 839067cf1..1c5dc09a6 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.info': { + GET: (params: { roomId: string }) => { channel: IServerRoomItem }; + }; 'channels.counters': { GET: (params: { roomId: string }) => { joined: boolean; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 87fc879e3..0f66e9609 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -285,10 +285,8 @@ export const getRoomCounters = ( // RC 0.65.0 sdk.get(`${roomTypeToApiType(t)}.counters`, { roomId }); -export const getChannelInfo = (roomId: string): any => +export const getChannelInfo = (roomId: string) => // RC 0.48.0 - // TODO: missing definitions from server - // @ts-ignore sdk.get('channels.info', { roomId }); export const getUserPreferences = (userId: string): any => diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index d3c894014..ed56fc72f 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -106,7 +106,7 @@ class RoomActionsView extends React.Component