diff --git a/app/definitions/rest/v1/channels.ts b/app/definitions/rest/v1/channels.ts index 2b5dd5f25..dfc0cd61d 100644 --- a/app/definitions/rest/v1/channels.ts +++ b/app/definitions/rest/v1/channels.ts @@ -70,4 +70,10 @@ export type ChannelsEndpoints = { 'channels.removeModerator': { POST: (params: { roomId: string; userId: string }) => {}; }; + 'channels.addOwner': { + POST: (params: { roomId: string; userId: string }) => {}; + }; + 'channels.removeOwner': { + POST: (params: { roomId: string; userId: string }) => {}; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 089ea8dc9..113354de9 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -458,17 +458,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 = ({