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: {
|
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,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user