From cb8d4be7eb823a70ab415fb2b8cdb00ec2af8230 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Wed, 2 Mar 2022 16:00:51 -0300 Subject: [PATCH] Chore: Migrate REST API - getDepartmentInfo to Typescript (#3795) --- app/definitions/rest/v1/omnichannel.ts | 3 +++ app/lib/rocketchat/services/restApi.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/definitions/rest/v1/omnichannel.ts b/app/definitions/rest/v1/omnichannel.ts index df4441370..3a7d6bcec 100644 --- a/app/definitions/rest/v1/omnichannel.ts +++ b/app/definitions/rest/v1/omnichannel.ts @@ -76,6 +76,9 @@ export type OmnichannelEndpoints = { GET: (params: { sort: string }) => PaginatedResult<{ agents: ILivechatDepartmentAgents[] }>; POST: (params: { upsert: string[]; remove: string[] }) => void; }; + 'livechat/department/:departmentId/?includeAgents=false': { + GET: () => PaginatedResult<{ department: ILivechatDepartment[] }>; + }; 'livechat/departments.available-by-unit/:id': { GET: (params: PaginatedRequest<{ text: string }>) => PaginatedResult<{ departments: ILivechatDepartment[]; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index fa2fb91b8..75c80c6b5 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -406,7 +406,7 @@ export const forwardLivechat = (transferData: any) => // RC 0.36.0 sdk.methodCallWrapper('livechat:transfer', transferData); -export const getDepartmentInfo = (departmentId: string): any => +export const getDepartmentInfo = (departmentId: string) => // RC 2.2.0 sdk.get(`livechat/department/${departmentId}?includeAgents=false`);