chore: add rest api return (#3847)

This commit is contained in:
Alex Junior 2022-03-07 12:40:38 -03:00 committed by GitHub
parent 261b380818
commit 518ad5f64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -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 }) => {};
};
};

View File

@ -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 = ({