chore: add rest api return (#3849)
This commit is contained in:
parent
ec7538abfd
commit
c72b524ac0
|
@ -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 }) => {};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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 }) =>
|
||||
|
|
Loading…
Reference in New Issue