refactor: code improvements in axiosConfig, config handler and auth helper

This commit is contained in:
Joel Jacob Stephen
2024-03-05 09:17:50 +05:30
parent 446d29f519
commit f99bfda88b
3 changed files with 5 additions and 7 deletions

View File

@@ -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'
),
},
};

View File

@@ -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;

View File

@@ -19,6 +19,7 @@ const restApi = axios.create({
const listmonkApi = axios.create({
...baseConfig,
withCredentials: false,
baseURL: 'https://listmonk.hoppscotch.com/api/public',
});