From 4cfadbc97bfb7e83aa93814169bc43f4a12bb014 Mon Sep 17 00:00:00 2001 From: Alex Junior Date: Tue, 15 Mar 2022 22:25:48 -0300 Subject: [PATCH] Chore: Migrate REST API - getSyncThreadsList to Typescript (#3896) --- 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 7b9deb43e..81d3ebe57 100644 --- a/app/definitions/rest/v1/chat.ts +++ b/app/definitions/rest/v1/chat.ts @@ -47,6 +47,14 @@ export type ChatEndpoints = { total: number; }>; }; + 'chat.syncThreadsList': { + GET: (params: { rid: IServerRoom['_id']; updatedSince: string }) => { + threads: { + update: IMessage[]; + remove: IMessage[]; + }; + }; + }; 'chat.delete': { POST: (params: { msgId: string; roomId: string }) => { _id: string; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index e8fb6eae0..2e06f0c26 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -668,10 +668,8 @@ export const getThreadsList = ({ rid, count, offset, text }: { rid: string; coun return sdk.get('chat.getThreadsList', params); }; -export const getSyncThreadsList = ({ rid, updatedSince }: { rid: string; updatedSince: string }): any => +export const getSyncThreadsList = ({ rid, updatedSince }: { rid: string; updatedSince: string }) => // RC 1.0 - // TODO: missing definitions from server - // @ts-ignore sdk.get('chat.syncThreadsList', { rid, updatedSince