Chore: Migrate REST API - sendEmailCode to Typescript (#3891)
This commit is contained in:
parent
ccdbd9543c
commit
0023f0e195
|
@ -365,10 +365,11 @@ const RocketChat = {
|
||||||
methodCall(...args) {
|
methodCall(...args) {
|
||||||
return sdk.methodCall(...args);
|
return sdk.methodCall(...args);
|
||||||
},
|
},
|
||||||
sendEmailCode() {
|
addUsersToRoom(rid) {
|
||||||
const { username } = reduxStore.getState().login.user;
|
let { users } = reduxStore.getState().selectedUsers;
|
||||||
// RC 3.1.0
|
users = users.map(u => u.name);
|
||||||
return this.post('users.2fa.sendEmailCode', { emailOrUsername: username });
|
// RC 0.51.0
|
||||||
|
return this.methodCallWrapper('addUsersToRoom', { rid, users });
|
||||||
},
|
},
|
||||||
hasRole(role) {
|
hasRole(role) {
|
||||||
const shareUser = reduxStore.getState().share.user;
|
const shareUser = reduxStore.getState().share.user;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
IRoom,
|
IRoom,
|
||||||
IRoomNotifications,
|
IRoomNotifications,
|
||||||
SubscriptionType,
|
SubscriptionType,
|
||||||
|
IUser,
|
||||||
TRocketChat
|
TRocketChat
|
||||||
} from '../../../definitions';
|
} from '../../../definitions';
|
||||||
import { TParams } from '../../../definitions/ILivechatEditView';
|
import { TParams } from '../../../definitions/ILivechatEditView';
|
||||||
|
@ -805,3 +806,9 @@ export const editMessage = async (message: IMessage) => {
|
||||||
// RC 0.49.0
|
// RC 0.49.0
|
||||||
return sdk.post('chat.update', { roomId: rid, msgId: message.id, text: msg });
|
return sdk.post('chat.update', { roomId: rid, msgId: message.id, text: msg });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const sendEmailCode = () => {
|
||||||
|
const { username } = reduxStore.getState().login.user as IUser;
|
||||||
|
// RC 3.1.0
|
||||||
|
return sdk.post('users.2fa.sendEmailCode', { emailOrUsername: username });
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue