Chore: Migrate REST API - toggleRead to Typescript (#3820)

This commit is contained in:
Gleidson Daniel Silva 2022-03-04 10:38:05 -03:00 committed by GitHub
parent c6824e7fcf
commit a7ecc1e427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -1,5 +1,8 @@
export type SubscriptionsEndpoints = { export type SubscriptionsEndpoints = {
'subscriptions.unread': { 'subscriptions.unread': {
POST: (params: { firstUnreadMessage: { _id: string } }) => {}; POST: (params: { firstUnreadMessage: { _id: string } } | { roomId: string }) => {};
};
'subscriptions.read': {
POST: (params: { rid: string }) => {};
}; };
}; };

View File

@ -295,14 +295,10 @@ export const setReaction = (emoji: string, messageId: string): any =>
// @ts-ignore // @ts-ignore
sdk.post('chat.react', { emoji, messageId }); sdk.post('chat.react', { emoji, messageId });
export const toggleRead = (read: boolean, roomId: string): any => { export const toggleRead = (read: boolean, roomId: string) => {
if (read) { if (read) {
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('subscriptions.unread', { roomId }); return sdk.post('subscriptions.unread', { roomId });
} }
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('subscriptions.read', { rid: roomId }); return sdk.post('subscriptions.read', { rid: roomId });
}; };