From 46e5ff40f5c05686668a9a7f44f711be068702f0 Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Mon, 12 Jun 2023 19:58:26 +0000 Subject: [PATCH] [CodeFactor] Apply fixes --- hapi/src/utils/producer.util.js | 13 ++++++++----- webapp/src/routes/EndpointsList/styles.js | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hapi/src/utils/producer.util.js b/hapi/src/utils/producer.util.js index d8c2ad58..edaff8c6 100644 --- a/hapi/src/utils/producer.util.js +++ b/hapi/src/utils/producer.util.js @@ -11,7 +11,9 @@ const getUrlStatus = async (url, api = '') => { url = url.replace(urlRegex, '') try { - const response = await axiosUtil.instance.get(`${url}${api}`, { timeout: 30000 }) + const response = await axiosUtil.instance.get(`${url}${api}`, { + timeout: 30000 + }) return response } catch (error) { @@ -19,9 +21,9 @@ const getUrlStatus = async (url, api = '') => { } } -const isP2PResponding = async endpoint => { +const isP2PResponding = async (endpoint) => { const splitted = endpoint?.split(':') || {} - const { [0]: host, [1]: port } = splitted + const { 0: host, 1: port } = splitted if (splitted.length !== 2 || !host || !port) return { status: 'Failed', statusText: 'Invalid endpoint format' } @@ -32,7 +34,7 @@ const isP2PResponding = async endpoint => { resolve({ status: 'Success', statusText: 'Connection established' }) }) - client.on('error', err => { + client.on('error', (err) => { let errorMessage = '' switch (Math.abs(err?.errno)) { @@ -70,7 +72,8 @@ const getSupportedAPIs = async (api) => { try { const response = await axiosUtil.instance.get( - `${api}/v1/node/get_supported_apis`, { timeout: 30000 } + `${api}/v1/node/get_supported_apis`, + { timeout: 30000 } ) supportedAPIs = response.data?.apis diff --git a/webapp/src/routes/EndpointsList/styles.js b/webapp/src/routes/EndpointsList/styles.js index 91f5b6b9..739ec412 100644 --- a/webapp/src/routes/EndpointsList/styles.js +++ b/webapp/src/routes/EndpointsList/styles.js @@ -47,7 +47,7 @@ export default (theme) => ({ boxShadow: '0px 1px 5px rgba(0, 0, 0, 0.15) !important', }, noShadow: { - '& .MuiPaper-root':{ + '& .MuiPaper-root': { boxShadow: 'none !important' } }