From 5686cd6cb22ac47cae742ded64f80d1dd84801f7 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Mon, 28 Feb 2022 12:06:02 -0400 Subject: [PATCH 1/2] create teams.create migration to ts --- app/definitions/rest/v1/teams.ts | 12 ++++++++++++ app/lib/rocketchat/services/restApi.ts | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/definitions/rest/v1/teams.ts b/app/definitions/rest/v1/teams.ts index 29047149d87..2ab801f26be 100644 --- a/app/definitions/rest/v1/teams.ts +++ b/app/definitions/rest/v1/teams.ts @@ -1,7 +1,19 @@ import { IRoom } from '../../IRoom'; +import { ITeam, TEAM_TYPE } from '../../ITeam'; export type TeamsEndpoints = { 'teams.removeRoom': { POST: (params: { roomId: string; teamId: string }) => { room: IRoom }; }; + 'teams.create': { + POST: (params: { + name: string; + users: string[]; + type: TEAM_TYPE; + room: { readOnly: boolean; extraData: { broadcast: boolean; encrypted: boolean } }; + }) => { + team: ITeam; + success: boolean; + }; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index b24129af5f2..2afc9b7b4f5 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -153,7 +153,7 @@ export const createTeam = ({ readOnly: boolean; broadcast: boolean; encrypted: boolean; -}): any => { +}) => { const params = { name, users, @@ -167,8 +167,6 @@ export const createTeam = ({ } }; // RC 3.13.0 - // TODO: missing definitions from server - // @ts-ignore return sdk.post('teams.create', params); }; export const addRoomsToTeam = ({ teamId, rooms }: { teamId: string; rooms: string[] }): any => From aad2e7e0c83937040f06472dde88a23dd0bae1ab Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 2 Mar 2022 13:55:09 -0400 Subject: [PATCH 2/2] remove: `success` from `teams.create` return --- app/definitions/rest/v1/teams.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/definitions/rest/v1/teams.ts b/app/definitions/rest/v1/teams.ts index 2ab801f26be..cc6bfd620c2 100644 --- a/app/definitions/rest/v1/teams.ts +++ b/app/definitions/rest/v1/teams.ts @@ -11,9 +11,6 @@ export type TeamsEndpoints = { users: string[]; type: TEAM_TYPE; room: { readOnly: boolean; extraData: { broadcast: boolean; encrypted: boolean } }; - }) => { - team: ITeam; - success: boolean; - }; + }) => { team: ITeam }; }; };