chore: add rest api return (#3847)
This commit is contained in:
parent
261b380818
commit
518ad5f64e
|
@ -70,4 +70,10 @@ export type ChannelsEndpoints = {
|
||||||
'channels.removeModerator': {
|
'channels.removeModerator': {
|
||||||
POST: (params: { roomId: string; userId: string }) => {};
|
POST: (params: { roomId: string; userId: string }) => {};
|
||||||
};
|
};
|
||||||
|
'channels.addOwner': {
|
||||||
|
POST: (params: { roomId: string; userId: string }) => {};
|
||||||
|
};
|
||||||
|
'channels.removeOwner': {
|
||||||
|
POST: (params: { roomId: string; userId: string }) => {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -458,17 +458,14 @@ export const toggleRoomOwner = ({
|
||||||
t: SubscriptionType;
|
t: SubscriptionType;
|
||||||
userId: string;
|
userId: string;
|
||||||
isOwner: boolean;
|
isOwner: boolean;
|
||||||
}): any => {
|
}) => {
|
||||||
|
const type = t as SubscriptionType.CHANNEL;
|
||||||
if (isOwner) {
|
if (isOwner) {
|
||||||
// RC 0.49.4
|
// RC 0.49.4
|
||||||
// TODO: missing definitions from server
|
return sdk.post(`${roomTypeToApiType(type)}.addOwner`, { roomId, userId });
|
||||||
// @ts-ignore
|
|
||||||
return sdk.post(`${roomTypeToApiType(t)}.addOwner`, { roomId, userId });
|
|
||||||
}
|
}
|
||||||
// RC 0.49.4
|
// RC 0.49.4
|
||||||
// TODO: missing definitions from server
|
return sdk.post(`${roomTypeToApiType(type)}.removeOwner`, { roomId, userId });
|
||||||
// @ts-ignore
|
|
||||||
return sdk.post(`${roomTypeToApiType(t)}.removeOwner`, { roomId, userId });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toggleRoomLeader = ({
|
export const toggleRoomLeader = ({
|
||||||
|
|
Loading…
Reference in New Issue