diff --git a/app/lib/rocketchat/rocketchat.js b/app/lib/rocketchat/rocketchat.js index 394bb483..9857b771 100644 --- a/app/lib/rocketchat/rocketchat.js +++ b/app/lib/rocketchat/rocketchat.js @@ -244,13 +244,6 @@ const RocketChat = { getRooms, readMessages, resendMessage, - createGroupChat() { - const { users } = reduxStore.getState().selectedUsers; - const usernames = users.map(u => u.name).join(','); - - // RC 3.1.0 - return this.post('im.create', { usernames }); - }, triggerBlockAction, triggerSubmitView, triggerCancel, diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 981f4961..30a896a4 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -753,6 +753,14 @@ export const useInviteToken = (token: string): any => // @ts-ignore sdk.post('useInviteToken', { token }); +export const createGroupChat = () => { + const { users } = reduxStore.getState().selectedUsers; + const usernames = users.map(u => u.name).join(','); + + // RC 3.1.0 + return sdk.post('im.create', { usernames }); +}; + export const addUsersToRoom = (rid: string): Promise => { const { users: selectedUsers } = reduxStore.getState().selectedUsers; const users = selectedUsers.map(u => u.name);