Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/definitions/rest/v1/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ export type ChannelsEndpoints = {
'channels.convertToTeam': {
POST: (params: { channelId: string; channelName: string }) => { team: ITeam };
};
'channels.addModerator': {
POST: (params: { roomId: string; userId: string }) => {};
};
'channels.removeModerator': {
POST: (params: { roomId: string; userId: string }) => {};
};
};
11 changes: 4 additions & 7 deletions app/lib/rocketchat/services/restApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,17 +509,14 @@ export const toggleRoomModerator = ({
t: SubscriptionType;
userId: string;
isModerator: boolean;
}): any => {
}) => {
const type = t as SubscriptionType.CHANNEL;
if (isModerator) {
// RC 0.49.4
// TODO: missing definitions from server
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.addModerator`, { roomId, userId });
return sdk.post(`${roomTypeToApiType(type)}.addModerator`, { roomId, userId });
}
// RC 0.49.4
// TODO: missing definitions from server
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.removeModerator`, { roomId, userId });
return sdk.post(`${roomTypeToApiType(type)}.removeModerator`, { roomId, userId });
};

export const removeUserFromRoom = ({ roomId, t, userId }: { roomId: string; t: SubscriptionType; userId: string }): any =>
Expand Down