chore: add rest api return (#3848)
This commit is contained in:
parent
518ad5f64e
commit
637d69bb17
|
@ -76,4 +76,10 @@ export type ChannelsEndpoints = {
|
||||||
'channels.removeOwner': {
|
'channels.removeOwner': {
|
||||||
POST: (params: { roomId: string; userId: string }) => {};
|
POST: (params: { roomId: string; userId: string }) => {};
|
||||||
};
|
};
|
||||||
|
'channels.addLeader': {
|
||||||
|
POST: (params: { roomId: string; userId: string }) => {};
|
||||||
|
};
|
||||||
|
'channels.removeLeader': {
|
||||||
|
POST: (params: { roomId: string; userId: string }) => {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -478,17 +478,14 @@ export const toggleRoomLeader = ({
|
||||||
t: SubscriptionType;
|
t: SubscriptionType;
|
||||||
userId: string;
|
userId: string;
|
||||||
isLeader: boolean;
|
isLeader: boolean;
|
||||||
}): any => {
|
}) => {
|
||||||
|
const type = t as SubscriptionType.CHANNEL;
|
||||||
if (isLeader) {
|
if (isLeader) {
|
||||||
// RC 0.58.0
|
// RC 0.58.0
|
||||||
// TODO: missing definitions from server
|
return sdk.post(`${roomTypeToApiType(type)}.addLeader`, { roomId, userId });
|
||||||
// @ts-ignore
|
|
||||||
return sdk.post(`${roomTypeToApiType(t)}.addLeader`, { roomId, userId });
|
|
||||||
}
|
}
|
||||||
// RC 0.58.0
|
// RC 0.58.0
|
||||||
// TODO: missing definitions from server
|
return sdk.post(`${roomTypeToApiType(type)}.removeLeader`, { roomId, userId });
|
||||||
// @ts-ignore
|
|
||||||
return sdk.post(`${roomTypeToApiType(t)}.removeLeader`, { roomId, userId });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toggleRoomModerator = ({
|
export const toggleRoomModerator = ({
|
||||||
|
|
Loading…
Reference in New Issue