From 4bec55e67f779eee6f08992693a79d59155dda88 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 1 Mar 2022 19:20:58 -0400 Subject: [PATCH 1/3] migrate deleteMessage to ts --- app/definitions/rest/v1/chat.ts | 8 ++++++++ app/lib/rocketchat/services/restApi.ts | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/definitions/rest/v1/chat.ts b/app/definitions/rest/v1/chat.ts index 4a224c4752f..3cea2c7c9d0 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -32,4 +32,12 @@ export type ChatEndpoints = { total: number; }>; }; + 'chat.delete': { + POST: (params: { msgId: string; roomId: string }) => { + _id: string; + ts: Date; + message: Pick; + success: boolean; + }; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index b24129af5f2..31c0176658d 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -258,10 +258,8 @@ export const joinRoom = (roomId: string, joinCode: string, type: 'c' | 'p'): any 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 }): any => From 1ef73298ae1b1fd21e6560bcf488c107dd712aea Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 2 Mar 2022 13:00:56 -0400 Subject: [PATCH 2/3] remove: success field from `chats.delete` return --- app/definitions/rest/v1/chat.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/definitions/rest/v1/chat.ts b/app/definitions/rest/v1/chat.ts index 3cea2c7c9d0..eb2d2a10c95 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -37,7 +37,6 @@ export type ChatEndpoints = { _id: string; ts: Date; message: Pick; - success: boolean; }; }; }; From 71d8bb57615f75c83ebd5de2924b3299b0da5cfb Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 2 Mar 2022 13:35:12 -0400 Subject: [PATCH 3/3] update: `ts` type --- app/definitions/rest/v1/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/definitions/rest/v1/chat.ts b/app/definitions/rest/v1/chat.ts index eb2d2a10c95..6b4253966f5 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -35,7 +35,7 @@ export type ChatEndpoints = { 'chat.delete': { POST: (params: { msgId: string; roomId: string }) => { _id: string; - ts: Date; + ts: string; message: Pick; }; };