From 4989e6cb5c6d6285e0d4e1a5f4963283bf65a6da Mon Sep 17 00:00:00 2001 From: Alex Junior Date: Sat, 5 Mar 2022 00:08:26 -0300 Subject: [PATCH] chore: add rest api return (#3824) --- app/definitions/rest/v1/chat.ts | 6 ++++++ app/lib/rocketchat/services/restApi.ts | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/definitions/rest/v1/chat.ts b/app/definitions/rest/v1/chat.ts index 6b4253966..cd99ad6b3 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -11,6 +11,12 @@ export type ChatEndpoints = { 'chat.followMessage': { POST: (params: { mid: IMessage['_id'] }) => void; }; + 'chat.unStarMessage': { + POST: (params: { messageId: IMessage['_id'] }) => void; + }; + 'chat.starMessage': { + POST: (params: { messageId: IMessage['_id'] }) => void; + }; 'chat.unfollowMessage': { POST: (params: { mid: IMessage['_id'] }) => void; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 5ebe74977..e2ed1deaf 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -239,16 +239,12 @@ export const markAsUnread = ({ messageId }: { messageId: string }) => // RC 0.65.0 sdk.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } }); -export const toggleStarMessage = (messageId: string, starred: boolean): any => { +export const toggleStarMessage = (messageId: string, starred: boolean) => { if (starred) { // RC 0.59.0 - // TODO: missing definitions from server - // @ts-ignore return sdk.post('chat.unStarMessage', { messageId }); } // RC 0.59.0 - // TODO: missing definitions from server - // @ts-ignore return sdk.post('chat.starMessage', { messageId }); };