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