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': { 'channels.leave': {
POST: (params: { roomId: string }) => {}; 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; t: SubscriptionType;
userId: string; userId: string;
isModerator: boolean; isModerator: boolean;
}): any => { }) => {
const type = t as SubscriptionType.CHANNEL;
if (isModerator) { if (isModerator) {
// RC 0.49.4 // RC 0.49.4
// TODO: missing definitions from server return sdk.post(`${roomTypeToApiType(type)}.addModerator`, { roomId, userId });
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.addModerator`, { roomId, userId });
} }
// RC 0.49.4 // RC 0.49.4
// TODO: missing definitions from server return sdk.post(`${roomTypeToApiType(type)}.removeModerator`, { roomId, userId });
// @ts-ignore
return sdk.post(`${roomTypeToApiType(t)}.removeModerator`, { roomId, userId });
}; };
export const removeUserFromRoom = ({ roomId, t, userId }: { roomId: string; t: RoomTypes; userId: string }) => export const removeUserFromRoom = ({ roomId, t, userId }: { roomId: string; t: RoomTypes; userId: string }) =>