Chore: Migrate REST API - convertTeamToChannel to TS (#3800)
* Migrate REST API `teams.convertToChannel` to TypeScript
This commit is contained in:
parent
af3a6c5da1
commit
e8a80d391b
|
@ -5,6 +5,9 @@ export type TeamsEndpoints = {
|
|||
'teams.removeRoom': {
|
||||
POST: (params: { roomId: string; teamId: string }) => { room: IRoom };
|
||||
};
|
||||
'teams.convertToChannel': {
|
||||
POST: (params: { teamId: string; roomsToRemove?: string[] }) => {};
|
||||
};
|
||||
'teams.removeMember': {
|
||||
POST: (params: { teamId: string; userId: string; rooms?: string[] }) => {};
|
||||
};
|
||||
|
|
|
@ -224,13 +224,11 @@ export const convertChannelToTeam = ({ rid, name, type }: { rid: string; name: s
|
|||
return sdk.post(type === 'c' ? 'channels.convertToTeam' : 'groups.convertToTeam', params);
|
||||
};
|
||||
|
||||
export const convertTeamToChannel = ({ teamId, selected }: { teamId: string; selected: string[] }): any => {
|
||||
export const convertTeamToChannel = ({ teamId, selected }: { teamId: string; selected: string[] }) => {
|
||||
const params = {
|
||||
teamId,
|
||||
...(selected.length && { roomsToRemove: selected })
|
||||
};
|
||||
// TODO: missing definitions from server
|
||||
// @ts-ignore
|
||||
return sdk.post('teams.convertToChannel', params);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue