Skip to content

Commit

Permalink
[CodeFactor] Apply fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
code-factor committed Jun 12, 2023
1 parent e8d3701 commit 46e5ff4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions hapi/src/utils/producer.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ 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) {
return error.response
}
}

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' }
Expand All @@ -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)) {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/routes/EndpointsList/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
Expand Down

0 comments on commit 46e5ff4

Please sign in to comment.