diff --git a/app/definitions/rest/v1/teams.ts b/app/definitions/rest/v1/teams.ts index 971b4abcb..e282e630f 100644 --- a/app/definitions/rest/v1/teams.ts +++ b/app/definitions/rest/v1/teams.ts @@ -1,17 +1,13 @@ import { IServerRoom } from '../../IRoom'; import { IServerTeamUpdateRoom, ITeam, TEAM_TYPE } from '../../ITeam'; +import { PaginatedResult } from '../helpers/PaginatedResult'; export type TeamsEndpoints = { 'teams.removeRoom': { POST: (params: { roomId: string; teamId: string }) => { room: IServerRoom }; }; 'teams.listRoomsOfUser': { - GET: (params: { teamId: string; userId: string }) => { - rooms: IServerRoom[]; - total: number; - count: number; - offset: number; - }; + GET: (params: { teamId: string; userId: string }) => PaginatedResult<{ rooms: IServerRoom[] }>; }; 'teams.updateRoom': { POST: (params: { roomId: string; isDefault: boolean }) => { room: IServerTeamUpdateRoom }; @@ -33,4 +29,13 @@ export type TeamsEndpoints = { room: { readOnly: boolean; extraData: { broadcast: boolean; encrypted: boolean } }; }) => { team: ITeam }; }; + 'teams.listRooms': { + GET: (params: { + teamId: string; + count: number; + offset: number; + type: string; + filter?: any; + }) => PaginatedResult<{ rooms: IServerTeamUpdateRoom[] }>; + }; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index e5a795b03..aa3e40142 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -319,7 +319,7 @@ export const getTeamListRoom = ({ offset: number; type: string; filter: any; -}): any => { +}) => { const params: any = { teamId, count, @@ -331,8 +331,6 @@ export const getTeamListRoom = ({ params.filter = filter; } // RC 3.13.0 - // TODO: missing definitions from server - // @ts-ignore return sdk.get('teams.listRooms', params); }; diff --git a/app/views/TeamChannelsView.tsx b/app/views/TeamChannelsView.tsx index a76c18ba8..5740f078d 100644 --- a/app/views/TeamChannelsView.tsx +++ b/app/views/TeamChannelsView.tsx @@ -187,8 +187,10 @@ class TeamChannelsView extends React.Component