Chore: Migrate REST API - convertTeamToChannel to TS (#3800)

* Migrate REST API `teams.convertToChannel` to TypeScript
This commit is contained in:
Gerzon Z 2022-03-02 17:29:30 -04:00 committed by GitHub
parent af3a6c5da1
commit e8a80d391b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,9 @@ export type TeamsEndpoints = {
'teams.removeRoom': { 'teams.removeRoom': {
POST: (params: { roomId: string; teamId: string }) => { room: IRoom }; POST: (params: { roomId: string; teamId: string }) => { room: IRoom };
}; };
'teams.convertToChannel': {
POST: (params: { teamId: string; roomsToRemove?: string[] }) => {};
};
'teams.removeMember': { 'teams.removeMember': {
POST: (params: { teamId: string; userId: string; rooms?: string[] }) => {}; POST: (params: { teamId: string; userId: string; rooms?: string[] }) => {};
}; };

View File

@ -224,13 +224,11 @@ export const convertChannelToTeam = ({ rid, name, type }: { rid: string; name: s
return sdk.post(type === 'c' ? 'channels.convertToTeam' : 'groups.convertToTeam', params); 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 = { const params = {
teamId, teamId,
...(selected.length && { roomsToRemove: selected }) ...(selected.length && { roomsToRemove: selected })
}; };
// TODO: missing definitions from server
// @ts-ignore
return sdk.post('teams.convertToChannel', params); return sdk.post('teams.convertToChannel', params);
}; };