chore: add rest api return (#3849)

This commit is contained in:
Alex Junior 2022-03-07 11:47:06 -03:00 committed by GitHub
parent ec7538abfd
commit c72b524ac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -64,4 +64,10 @@ export type ChannelsEndpoints = {
'channels.leave': {
POST: (params: { roomId: string }) => {};
};
'channels.addModerator': {
POST: (params: { roomId: string; userId: string }) => {};
};
'channels.removeModerator': {
POST: (params: { roomId: string; userId: string }) => {};
};
};

View File

@ -501,17 +501,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: RoomTypes; userId: string }) =>