diff --git a/app/definitions/rest/v1/index.ts b/app/definitions/rest/v1/index.ts index 83bb410d0..e292cb99b 100644 --- a/app/definitions/rest/v1/index.ts +++ b/app/definitions/rest/v1/index.ts @@ -15,6 +15,7 @@ import { UserEndpoints } from './user'; import { UsersEndpoints } from './users'; import { TeamsEndpoints } from './teams'; import { E2eEndpoints } from './e2e'; +import { SubscriptionsEndpoints } from './subscriptions'; export type Endpoints = ChannelsEndpoints & ChatEndpoints & @@ -32,4 +33,5 @@ export type Endpoints = ChannelsEndpoints & UserEndpoints & UsersEndpoints & TeamsEndpoints & - E2eEndpoints; + E2eEndpoints & + SubscriptionsEndpoints; diff --git a/app/definitions/rest/v1/subscriptions.ts b/app/definitions/rest/v1/subscriptions.ts new file mode 100644 index 000000000..c05e25cf2 --- /dev/null +++ b/app/definitions/rest/v1/subscriptions.ts @@ -0,0 +1,5 @@ +export type SubscriptionsEndpoints = { + 'subscriptions.unread': { + POST: (params: { firstUnreadMessage: { _id: string } }) => {}; + }; +}; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 2f1bf4a5c..83c061150 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -264,10 +264,8 @@ export const deleteMessage = (messageId: string, rid: string): any => // @ts-ignore sdk.post('chat.delete', { msgId: messageId, roomId: rid }); -export const markAsUnread = ({ messageId }: { messageId: string }): any => +export const markAsUnread = ({ messageId }: { messageId: string }) => // RC 0.65.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } }); export const toggleStarMessage = (messageId: string, starred: boolean): any => {