refactor: code improvements in axiosConfig, config handler and auth helper
This commit is contained in:
@@ -173,12 +173,9 @@ export function useConfigHandler(updatedConfigs?: Config) {
|
||||
},
|
||||
dataSharingConfigs: {
|
||||
name: 'data_sharing',
|
||||
enabled:
|
||||
infraConfigs.value.find(
|
||||
(x) => x.name === 'ALLOW_ANALYTICS_COLLECTION'
|
||||
)?.value === 'true'
|
||||
? true
|
||||
: false,
|
||||
enabled: !!infraConfigs.value.find(
|
||||
(x) => x.name === 'ALLOW_ANALYTICS_COLLECTION' && x.value === 'true'
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ export const auth = {
|
||||
getFirstTimeInfraSetupStatus: async (): Promise<boolean> => {
|
||||
try {
|
||||
const res = await authQuery.getFirstTimeInfraSetupStatus();
|
||||
return res.data?.value === 'true' ? true : false;
|
||||
return res.data?.value === 'true';
|
||||
} catch (err) {
|
||||
// Setup is not done
|
||||
return true;
|
||||
|
||||
@@ -19,6 +19,7 @@ const restApi = axios.create({
|
||||
|
||||
const listmonkApi = axios.create({
|
||||
...baseConfig,
|
||||
withCredentials: false,
|
||||
baseURL: 'https://listmonk.hoppscotch.com/api/public',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user