From cc6302386c981fcbd778d335a7a61f05fb353f6b Mon Sep 17 00:00:00 2001 From: liza-pohranichna Date: Thu, 28 Dec 2023 14:35:43 +0200 Subject: [PATCH] refactor: remove console.logs [WTEL-4061] --- src/modules/_shared/permissions-tab/api/PermissionsAPI.js | 2 -- .../integrations/modules/single-sign-on/api/singleSignOn.js | 1 - src/modules/routing/modules/chat-gateways/api/chatInstance.js | 4 ++-- .../chat-gateways/modules/messenger/facebook/api/facebook.js | 4 ++-- .../modules/messenger/instagram/api/instagram.js | 4 ++-- .../chat-gateways/modules/messenger/whatsapp/api/whatsapp.js | 4 ++-- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/modules/_shared/permissions-tab/api/PermissionsAPI.js b/src/modules/_shared/permissions-tab/api/PermissionsAPI.js index e7182c2ed..3c1c2b88a 100644 --- a/src/modules/_shared/permissions-tab/api/PermissionsAPI.js +++ b/src/modules/_shared/permissions-tab/api/PermissionsAPI.js @@ -7,13 +7,11 @@ export default class PermissionsAPI { constructor(url) { this.url = url; this._permissionsGetter = new APIPermissionsGetter(url); - console.log('this._permissionsGetter:', this._permissionsGetter); this._permissionsPatcher = new APIPermissionsPatcher(url); } static getListByUrl = (url) => { const permissionsGetter = new APIPermissionsGetter(url); - console.log('permissionsGetter:', permissionsGetter); return (params) => permissionsGetter.getList(params); }; diff --git a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js index 448683c07..7b02013cb 100644 --- a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js +++ b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js @@ -67,7 +67,6 @@ const getSingleSignOn = async ({ itemId: id }) => { try { const response = await instance.get(url); - console.log(response); return applyTransform(response.data, [ snakeToCamel(), merge(defaultObject), diff --git a/src/modules/routing/modules/chat-gateways/api/chatInstance.js b/src/modules/routing/modules/chat-gateways/api/chatInstance.js index 084f592d0..d7bc0ecce 100644 --- a/src/modules/routing/modules/chat-gateways/api/chatInstance.js +++ b/src/modules/routing/modules/chat-gateways/api/chatInstance.js @@ -5,13 +5,13 @@ import getChatOriginUrl from '../scripts/getChatOriginUrl'; const chatBaseUrl = new URL(path.normalize(import.meta.env.VITE_CHAT_URL), getChatOriginUrl()) .toString(); -console.log('Chat instanse') + const chatInstance = axios.create({ ...instance.config, baseURL: chatBaseUrl, }); -// defaultInterceptorsSetup({ instance: chatInstance, config }); +console.log('chatInstance:', chatInstance); export default chatInstance; export { chatBaseUrl }; diff --git a/src/modules/routing/modules/chat-gateways/modules/messenger/facebook/api/facebook.js b/src/modules/routing/modules/chat-gateways/modules/messenger/facebook/api/facebook.js index 84db6ff9c..83fe3410b 100644 --- a/src/modules/routing/modules/chat-gateways/modules/messenger/facebook/api/facebook.js +++ b/src/modules/routing/modules/chat-gateways/modules/messenger/facebook/api/facebook.js @@ -3,13 +3,13 @@ import chatInstance, { chatBaseUrl } from '../../../../api/chatInstance'; const defaultListObject = { accounts: [], }; -console.log('Facebook'); + /* I decided not to use api consumer because they do not have this flexibility to work with base url and params */ const getList = async ({ uri }) => { - console.log('Facebook get list'); const url = `${uri}?pages=`; const data = await chatInstance.get(url); + console.log('facebook get list data:', data); return data.map((item) => ({ ...defaultListObject, ...item })); }; diff --git a/src/modules/routing/modules/chat-gateways/modules/messenger/instagram/api/instagram.js b/src/modules/routing/modules/chat-gateways/modules/messenger/instagram/api/instagram.js index 6f6d17ecf..40222b38a 100644 --- a/src/modules/routing/modules/chat-gateways/modules/messenger/instagram/api/instagram.js +++ b/src/modules/routing/modules/chat-gateways/modules/messenger/instagram/api/instagram.js @@ -3,13 +3,13 @@ import chatInstance, { chatBaseUrl } from '../../../../api/chatInstance'; const defaultListObject = { accounts: [], }; -console.log('INSTAGRAM'); + /* I decided not to use api consumer because they do not have this flexibility to work with base url and params */ const getList = async ({ uri }) => { - console.log('INSTAGRAM getList'); const url = `${uri}?instagram=`; const data = await chatInstance.get(url); + console.log('instagram get list data:', data); return data.map((item) => ({ ...defaultListObject, ...item })); }; diff --git a/src/modules/routing/modules/chat-gateways/modules/messenger/whatsapp/api/whatsapp.js b/src/modules/routing/modules/chat-gateways/modules/messenger/whatsapp/api/whatsapp.js index 408b995d6..0b433f3e9 100644 --- a/src/modules/routing/modules/chat-gateways/modules/messenger/whatsapp/api/whatsapp.js +++ b/src/modules/routing/modules/chat-gateways/modules/messenger/whatsapp/api/whatsapp.js @@ -3,13 +3,13 @@ import chatInstance, { chatBaseUrl } from '../../../../api/chatInstance'; const defaultListObject = { phoneNumbers: [], }; -console.log('whatsapp'); + /* I decided not to use api consumer because they do not have this flexibility to work with base url and params */ const getList = async ({ uri }) => { const url = `${uri}?whatsapp=`; const data = await chatInstance.get(url); - console.log('whatsapp get list'); + console.log('watsapp get list data:', data); return data.map((item) => ({ ...defaultListObject, ...item })); };