From 3fff974b1e2cfa3499439a246be190aaad2907e3 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 29 May 2023 13:12:59 +0530 Subject: [PATCH] fix: removed undocumented fn (#419) --- packages/restapi/src/lib/chat/index.ts | 9 +++-- packages/restapi/src/lib/chat/updateUser.ts | 40 --------------------- 2 files changed, 4 insertions(+), 45 deletions(-) delete mode 100644 packages/restapi/src/lib/chat/updateUser.ts diff --git a/packages/restapi/src/lib/chat/index.ts b/packages/restapi/src/lib/chat/index.ts index 64c53e6be..8588cabd3 100644 --- a/packages/restapi/src/lib/chat/index.ts +++ b/packages/restapi/src/lib/chat/index.ts @@ -2,14 +2,13 @@ export * from './chats'; export * from './chat'; export * from './requests'; export * from './send'; -export * from "./conversationHash"; +export * from './conversationHash'; export * from './approveRequest'; -export * from './updateUser'; export * from './historicalMessages'; export * from './latestMessage'; -export { decryptWithWalletRPCMethod } from "../helpers/crypto"; -export { decryptPGPKey } from "../helpers/crypto"; -export { decryptConversation } from "./helpers"; +export { decryptWithWalletRPCMethod } from '../helpers/crypto'; +export { decryptPGPKey } from '../helpers/crypto'; +export { decryptConversation } from './helpers'; export * from './helpers/payloadHelper'; export * from './createGroup'; export * from './updateGroup'; diff --git a/packages/restapi/src/lib/chat/updateUser.ts b/packages/restapi/src/lib/chat/updateUser.ts deleted file mode 100644 index f6fd42ace..000000000 --- a/packages/restapi/src/lib/chat/updateUser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import axios from 'axios'; -import { getAPIBaseUrls } from '../helpers'; -import Constants, { ENV } from '../constants'; -import { IUser } from '../types'; - -export type ChatUpdateUserOptionsType = { - user: string; - profilePictureCID?: string; - name?: string; - env?: ENV; -}; - -export const updateUser = async ( - options: ChatUpdateUserOptionsType -): Promise => { - const { - user, - profilePictureCID = '', - name = '', - env = Constants.ENV.PROD, - } = options || {}; - - const API_BASE_URL = getAPIBaseUrls(env); - const apiEndpoint = `${API_BASE_URL}/v1/w2w/users/${user}`; - const body = { - caip10: user, - profilePictureCID, - name, - }; - - return axios - .put(apiEndpoint, body) - .then((response) => { - return response.data; - }) - .catch((err) => { - console.error(`[Push SDK] - API ${updateUser.name}: `, err); - throw Error(`[Push SDK] - API ${updateUser.name}: ${err}`); - }); -};