From 4ba7f16b71e0ea2c66e6ae3c80097c4adb25a24e Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 2 Mar 2022 17:45:05 -0400 Subject: [PATCH] Chore: Migrate REST API - deleteMessage to TS (#3802) * Migrate REST API `chats.delete` to TypeScript --- app/definitions/rest/v1/chat.ts | 7 +++++++ app/lib/rocketchat/services/restApi.ts | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/definitions/rest/v1/chat.ts b/app/definitions/rest/v1/chat.ts index 4a224c47..6b425396 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -32,4 +32,11 @@ export type ChatEndpoints = { total: number; }>; }; + 'chat.delete': { + POST: (params: { msgId: string; roomId: string }) => { + _id: string; + ts: string; + message: Pick; + }; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index c15970cd..5b27f610 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -243,10 +243,8 @@ export const joinRoom = (roomId: string, joinCode: string | null, type: 'c' | 'p return sdk.post('channels.join', { roomId, joinCode }); }; -export const deleteMessage = (messageId: string, rid: string): any => +export const deleteMessage = (messageId: string, rid: string) => // RC 0.48.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('chat.delete', { msgId: messageId, roomId: rid }); export const markAsUnread = ({ messageId }: { messageId: string }) =>