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.addOwner': {
POST: (params: { roomId: string; userId: string }) => {};
};
'channels.removeOwner': {
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 @@ -463,17 +463,14 @@ export const toggleRoomOwner = ({
t: SubscriptionType;
userId: string;
isOwner: boolean;
}): any => {
}) => {
const type = t as SubscriptionType.CHANNEL;
if (isOwner) {
// RC 0.49.4
// TODO: missing definitions from server
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.addOwner`, { roomId, userId });
return sdk.post(`${roomTypeToApiType(type)}.addOwner`, { roomId, userId });
}
// RC 0.49.4
// TODO: missing definitions from server
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.removeOwner`, { roomId, userId });
return sdk.post(`${roomTypeToApiType(type)}.removeOwner`, { roomId, userId });
};

export const toggleRoomLeader = ({
Expand Down