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: { dataSharingConfigs: {
name: 'data_sharing', name: 'data_sharing',
enabled: enabled: !!infraConfigs.value.find(
infraConfigs.value.find( (x) => x.name === 'ALLOW_ANALYTICS_COLLECTION' && x.value === 'true'
(x) => x.name === 'ALLOW_ANALYTICS_COLLECTION' ),
)?.value === 'true'
? true
: false,
}, },
}; };

View File

@@ -244,7 +244,7 @@ export const auth = {
getFirstTimeInfraSetupStatus: async (): Promise<boolean> => { getFirstTimeInfraSetupStatus: async (): Promise<boolean> => {
try { try {
const res = await authQuery.getFirstTimeInfraSetupStatus(); const res = await authQuery.getFirstTimeInfraSetupStatus();
return res.data?.value === 'true' ? true : false; return res.data?.value === 'true';
} catch (err) { } catch (err) {
// Setup is not done // Setup is not done
return true; return true;

View File

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