feat: added new configs and mutations for data sharing in config handler and server restart

This commit is contained in:
Joel Jacob Stephen
2024-02-20 18:58:43 +05:30
parent 55293a0382
commit e261f75cc8
2 changed files with 36 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ import {
EnableAndDisableSsoDocument,
ResetInfraConfigsDocument,
UpdateInfraConfigsDocument,
ToggleAnalyticsCollectionDocument,
} from '~/helpers/backend/graphql';
const t = useI18n();
@@ -43,10 +44,17 @@ const updateInfraConfigsMutation = useMutation(UpdateInfraConfigsDocument);
const updateAllowedAuthProviderMutation = useMutation(
EnableAndDisableSsoDocument
);
const toggleDataSharingMutation = useMutation(
ToggleAnalyticsCollectionDocument
);
// Mutation handlers
const { updateInfraConfigs, updateAuthProvider, resetInfraConfigs } =
useConfigHandler(props.workingConfigs);
const {
updateInfraConfigs,
updateAuthProvider,
resetInfraConfigs,
updateDataSharingConfigs,
} = useConfigHandler(props.workingConfigs);
// Call relevant mutations on component mount and initiate server restart
const duration = ref(30);
@@ -80,6 +88,12 @@ onMounted(async () => {
updateAllowedAuthProviderMutation
);
if (!authResult) return;
const dataSharingReult = await updateDataSharingConfigs(
toggleDataSharingMutation
);
if (!dataSharingReult) return;
}
restart.value = true;