Chore: Migrate REST API - toggleRead to Typescript (#3820)
This commit is contained in:
parent
c6824e7fcf
commit
a7ecc1e427
|
@ -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 }) => {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue