chore: add rest api return (#3848)

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

View File

@ -76,4 +76,10 @@ export type ChannelsEndpoints = {
'channels.removeOwner': {
POST: (params: { roomId: string; userId: string }) => {};
};
'channels.addLeader': {
POST: (params: { roomId: string; userId: string }) => {};
};
'channels.removeLeader': {
POST: (params: { roomId: string; userId: string }) => {};
};
};

View File

@ -478,17 +478,14 @@ export const toggleRoomLeader = ({
t: SubscriptionType;
userId: string;
isLeader: boolean;
}): any => {
}) => {
const type = t as SubscriptionType.CHANNEL;
if (isLeader) {
// RC 0.58.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.addLeader`, { roomId, userId });
return sdk.post(`${roomTypeToApiType(type)}.addLeader`, { roomId, userId });
}
// RC 0.58.0
// TODO: missing definitions from server
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.removeLeader`, { roomId, userId });
return sdk.post(`${roomTypeToApiType(type)}.removeLeader`, { roomId, userId });
};
export const toggleRoomModerator = ({