From 4dc43313abc900e2601e1fdf0d5d4fbc4dae33a4 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:44:55 -0300 Subject: [PATCH] Chore: Migrate REST API - getUsernameSuggestion to Typescript (#3872) --- app/definitions/rest/v1/users.ts | 3 +++ app/lib/rocketchat/services/restApi.ts | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/definitions/rest/v1/users.ts b/app/definitions/rest/v1/users.ts index 17b0e1e8..035e6250 100644 --- a/app/definitions/rest/v1/users.ts +++ b/app/definitions/rest/v1/users.ts @@ -43,6 +43,9 @@ export type UsersEndpoints = { user: IUser; }; }; + 'users.getUsernameSuggestion': { + GET: () => { result: string }; + }; 'users.resetAvatar': { POST: (params: { userId: string }) => {}; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index fe4e3a1a..cc5f9e36 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -586,10 +586,8 @@ export const setAvatarFromService = ({ // RC 0.51.0 sdk.methodCallWrapper('setAvatarFromService', data, contentType, service); -export const getUsernameSuggestion = (): any => +export const getUsernameSuggestion = () => // RC 0.65.0 - // TODO: missing definitions from server - // @ts-ignore sdk.get('users.getUsernameSuggestion'); export const getFiles = (roomId: string, type: RoomTypes, offset: number): any =>