From 270f6e0fefaf35b28093417d22f7dd404b0fdcd5 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 2 Mar 2022 16:28:58 -0400 Subject: [PATCH] Chore: Migrate REST API - addRoomsToTeam to TS (#3797) * Migrate REST API `teams.addRooms` to TypeScript --- app/definitions/rest/v1/teams.ts | 3 +++ app/lib/rocketchat/services/restApi.ts | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/definitions/rest/v1/teams.ts b/app/definitions/rest/v1/teams.ts index cc6bfd620..b728c00c1 100644 --- a/app/definitions/rest/v1/teams.ts +++ b/app/definitions/rest/v1/teams.ts @@ -5,6 +5,9 @@ export type TeamsEndpoints = { 'teams.removeRoom': { POST: (params: { roomId: string; teamId: string }) => { room: IRoom }; }; + 'teams.addRooms': { + POST: (params: { teamId: string; rooms: string[] }) => { rooms: IRoom[] }; + }; 'teams.create': { POST: (params: { name: string; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index b5947efae..6f6479ab0 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -164,10 +164,8 @@ export const createTeam = ({ // RC 3.13.0 return sdk.post('teams.create', params); }; -export const addRoomsToTeam = ({ teamId, rooms }: { teamId: string; rooms: string[] }): any => +export const addRoomsToTeam = ({ teamId, rooms }: { teamId: string; rooms: string[] }) => // RC 3.13.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('teams.addRooms', { teamId, rooms }); export const removeTeamRoom = ({ roomId, teamId }: { roomId: string; teamId: string }) =>