Chore: Migrate REST API - readThreads to Typescript (#3866)
* chore: migrate readThreads to typescript * fix imports
This commit is contained in:
parent
1d04e9379f
commit
1aab65ef92
|
@ -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;
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
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 { IAvatarSuggestion, IParams } from '../../../definitions/IProfileViewInterfaces';
|
||||
import { Encryption } from '../../encryption';
|
||||
import { TParams } from '../../../definitions/ILivechatEditView';
|
||||
import { store as reduxStore } from '../../auxStore';
|
||||
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 { 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(',');
|
||||
|
|
Loading…
Reference in New Issue