Chore: Migrate REST API - createGroupChat to Typescript (#3885)
* Chore: Migrate REST API - createGroupChat to Typescript * Update app/lib/rocketchat/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com> * minor tweak Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
This commit is contained in:
parent
de8a7f1ce0
commit
6d543c28d9
|
@ -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,
|
||||
|
|
|
@ -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<boolean> => {
|
||||
const { users: selectedUsers } = reduxStore.getState().selectedUsers;
|
||||
const users = selectedUsers.map(u => u.name);
|
||||
|
|
Loading…
Reference in New Issue