chore: add rest api return (#3825)

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

View File

@ -20,6 +20,12 @@ export type ChatEndpoints = {
'chat.unfollowMessage': {
POST: (params: { mid: IMessage['_id'] }) => void;
};
'chat.unPinMessage': {
POST: (params: { messageId: IMessage['_id'] }) => void;
};
'chat.pinMessage': {
POST: (params: { messageId: IMessage['_id'] }) => void;
};
'chat.getDiscussions': {
GET: (params: { roomId: IRoom['_id']; text?: string; offset: number; count: number }) => {
messages: IMessage[];

View File

@ -248,16 +248,12 @@ export const toggleStarMessage = (messageId: string, starred: boolean) => {
return sdk.post('chat.starMessage', { messageId });
};
export const togglePinMessage = (messageId: string, pinned: boolean): any => {
export const togglePinMessage = (messageId: string, pinned: boolean) => {
if (pinned) {
// RC 0.59.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('chat.unPinMessage', { messageId });
}
// RC 0.59.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('chat.pinMessage', { messageId });
};