diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 239487b1b..ac923025f 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -835,17 +835,21 @@ const RocketChat = { // RC 3.13.0 return this.post('teams.removeRoom', { roomId, teamId }); }, - leaveTeam({ teamName, rooms }) { + leaveTeam({ teamId, rooms }) { // RC 3.13.0 - return this.post('teams.leave', { teamName, rooms }); + return this.post('teams.leave', { + teamId, + // RC 4.2.0 + ...(rooms?.length && { rooms }) + }); }, - removeTeamMember({ teamId, teamName, userId, rooms }) { + removeTeamMember({ teamId, userId, rooms }) { // RC 3.13.0 return this.post('teams.removeMember', { teamId, - teamName, userId, - rooms + // RC 4.2.0 + ...(rooms?.length && { rooms }) }); }, updateTeamRoom({ roomId, isDefault }) { diff --git a/app/sagas/room.js b/app/sagas/room.js index e3437a4ae..f45bf123a 100644 --- a/app/sagas/room.js +++ b/app/sagas/room.js @@ -67,7 +67,7 @@ const handleLeaveRoom = function* handleLeaveRoom({ room, roomType, selected }) if (roomType === 'channel') { result = yield RocketChat.leaveRoom(room.rid, room.t); } else if (roomType === 'team') { - result = yield RocketChat.leaveTeam({ teamName: room.name, ...(selected && { rooms: selected }) }); + result = yield RocketChat.leaveTeam({ teamId: room.teamId, ...(selected && { rooms: selected }) }); } if (result?.success) { diff --git a/app/views/RoomMembersView/index.js b/app/views/RoomMembersView/index.js index 9a93d1cae..3f936fba6 100644 --- a/app/views/RoomMembersView/index.js +++ b/app/views/RoomMembersView/index.js @@ -246,7 +246,6 @@ class RoomMembersView extends React.Component { const userId = selectedUser._id; const result = await RocketChat.removeTeamMember({ teamId: room.teamId, - teamName: room.name, userId, ...(selected && { rooms: selected }) });