Chore: Migrate REST API - markAsUnread to TS (#3801)
* Migrate `subscriptions.unread` to typescript
This commit is contained in:
parent
ea357de74a
commit
71b184d38a
|
@ -15,6 +15,7 @@ import { UserEndpoints } from './user';
|
||||||
import { UsersEndpoints } from './users';
|
import { UsersEndpoints } from './users';
|
||||||
import { TeamsEndpoints } from './teams';
|
import { TeamsEndpoints } from './teams';
|
||||||
import { E2eEndpoints } from './e2e';
|
import { E2eEndpoints } from './e2e';
|
||||||
|
import { SubscriptionsEndpoints } from './subscriptions';
|
||||||
|
|
||||||
export type Endpoints = ChannelsEndpoints &
|
export type Endpoints = ChannelsEndpoints &
|
||||||
ChatEndpoints &
|
ChatEndpoints &
|
||||||
|
@ -32,4 +33,5 @@ export type Endpoints = ChannelsEndpoints &
|
||||||
UserEndpoints &
|
UserEndpoints &
|
||||||
UsersEndpoints &
|
UsersEndpoints &
|
||||||
TeamsEndpoints &
|
TeamsEndpoints &
|
||||||
E2eEndpoints;
|
E2eEndpoints &
|
||||||
|
SubscriptionsEndpoints;
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export type SubscriptionsEndpoints = {
|
||||||
|
'subscriptions.unread': {
|
||||||
|
POST: (params: { firstUnreadMessage: { _id: string } }) => {};
|
||||||
|
};
|
||||||
|
};
|
|
@ -264,10 +264,8 @@ export const deleteMessage = (messageId: string, rid: string): any =>
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sdk.post('chat.delete', { msgId: messageId, roomId: rid });
|
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
|
// RC 0.65.0
|
||||||
// TODO: missing definitions from server
|
|
||||||
// @ts-ignore
|
|
||||||
sdk.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } });
|
sdk.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } });
|
||||||
|
|
||||||
export const toggleStarMessage = (messageId: string, starred: boolean): any => {
|
export const toggleStarMessage = (messageId: string, starred: boolean): any => {
|
||||||
|
|
Loading…
Reference in New Issue