chore: add rest api return (#3824)

This commit is contained in:
Alex Junior 2022-03-05 00:08:26 -03:00 committed by GitHub
parent 0444e9b846
commit 4989e6cb5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -11,6 +11,12 @@ export type ChatEndpoints = {
'chat.followMessage': {
POST: (params: { mid: IMessage['_id'] }) => void;
};
'chat.unStarMessage': {
POST: (params: { messageId: IMessage['_id'] }) => void;
};
'chat.starMessage': {
POST: (params: { messageId: IMessage['_id'] }) => void;
};
'chat.unfollowMessage': {
POST: (params: { mid: IMessage['_id'] }) => void;
};

View File

@ -239,16 +239,12 @@ export const markAsUnread = ({ messageId }: { messageId: string }) =>
// RC 0.65.0
sdk.post('subscriptions.unread', { firstUnreadMessage: { _id: messageId } });
export const toggleStarMessage = (messageId: string, starred: boolean): any => {
export const toggleStarMessage = (messageId: string, starred: boolean) => {
if (starred) {
// RC 0.59.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('chat.unStarMessage', { messageId });
}
// RC 0.59.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('chat.starMessage', { messageId });
};