Unverified Commit 1aab65ef authored by Gleidson Daniel Silva's avatar Gleidson Daniel Silva Committed by GitHub
Browse files

Chore: Migrate REST API - readThreads to Typescript (#3866)

* chore: migrate readThreads to typescript

* fix imports
parent 1d04e937
......@@ -434,14 +434,6 @@ const RocketChat = {
getLoginServices,
determineAuthType,
roomTypeToApiType,
readThreads(tmid) {
const serverVersion = reduxStore.getState().server.version;
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '3.4.0')) {
// RC 3.4.0
return this.methodCallWrapper('readThreads', tmid);
}
return Promise.resolve();
},
_setUser(ddpMessage) {
this.activeUsers = this.activeUsers || {};
const { user } = reduxStore.getState().login;
......
import sdk from './sdk';
import { TEAM_TYPE } from '../../../definitions/ITeam';
import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType';
import {
SubscriptionType,
INotificationPreferences,
IRoomNotifications,
TRocketChat,
IMessage,
INotificationPreferences,
IPreviewItem,
IRoom,
IPreviewItem
IRoomNotifications,
SubscriptionType,
TRocketChat
} from '../../../definitions';
import { ISpotlight } from '../../../definitions/ISpotlight';
import { TParams } from '../../../definitions/ILivechatEditView';
import { IAvatarSuggestion, IParams } from '../../../definitions/IProfileViewInterfaces';
import { ISpotlight } from '../../../definitions/ISpotlight';
import { TEAM_TYPE } from '../../../definitions/ITeam';
import { store as reduxStore, store } from '../../auxStore';
import { Encryption } from '../../encryption';
import { TParams } from '../../../definitions/ILivechatEditView';
import { store as reduxStore } from '../../auxStore';
import { compareServerVersion } from '../../utils';
import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType';
import sdk from './sdk';
export const createChannel = ({
name,
......@@ -758,6 +759,15 @@ export const useInviteToken = (token: string): any =>
// @ts-ignore
sdk.post('useInviteToken', { token });
export const readThreads = (tmid: string): Promise<void> => {
const serverVersion = store.getState().server.version;
if (compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '3.4.0')) {
// RC 3.4.0
return sdk.methodCallWrapper('readThreads', tmid);
}
return Promise.resolve();
};
export const createGroupChat = () => {
const { users } = reduxStore.getState().selectedUsers;
const usernames = users.map(u => u.name).join(',');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment