diff --git a/src/components/CreateAdministration.vue b/src/components/CreateAdministration.vue index e83902215..0df0c082a 100644 --- a/src/components/CreateAdministration.vue +++ b/src/components/CreateAdministration.vue @@ -496,21 +496,27 @@ const submit = async () => { if (isTestData.value) args.isTestData = true; if (props.adminId) args.administrationId = props.adminId; - await roarfirekit.value.createAdministration(args).then(() => { - toast.add({ - severity: 'success', - summary: 'Success', - detail: props.adminId ? 'Administration updated' : 'Administration created', - life: 3000, + await roarfirekit.value + .createAdministration(args) + .then(() => { + toast.add({ + severity: 'success', + summary: 'Success', + detail: props.adminId ? 'Administration updated' : 'Administration created', + life: 3000, + }); + administrationQueryKeyIndex.value += 1; + + // TODO: Invalidate for administrations query. + // This does not work in prod for some reason. + // queryClient.invalidateQueries({ queryKey: ['administrations'] }) + + router.push({ name: 'Home' }); + }) + .catch((error) => { + toast.add({ severity: 'error', summary: 'Error', detail: error.message, life: 3000 }); + console.error('Error creating administration:', error.message); }); - administrationQueryKeyIndex.value += 1; - - // TODO: Invalidate for administrations query. - // This does not work in prod for some reason. - // queryClient.invalidateQueries({ queryKey: ['administrations'] }) - - router.push({ name: 'Home' }); - }); } else { console.log('need at least one org'); orgError.value = 'At least one organization needs to be selected.'; diff --git a/src/components/CreateOrgs.vue b/src/components/CreateOrgs.vue index fc528f0d5..8a7acbead 100644 --- a/src/components/CreateOrgs.vue +++ b/src/components/CreateOrgs.vue @@ -426,7 +426,7 @@ const submit = async () => { }) .catch((error) => { toast.add({ severity: 'error', summary: 'Error', detail: error.message, life: 3000 }); - console.error('Error creating org', error); + console.error('Error creating org:', error); }); } else { await roarfirekit.value @@ -438,7 +438,7 @@ const submit = async () => { }) .catch((error) => { toast.add({ severity: 'error', summary: 'Error', detail: error.message, life: 3000 }); - console.error('Error creating org', error); + console.error('Error creating org:', error); }); } } else { diff --git a/src/pages/LEVANTE/RegisterUsers.vue b/src/pages/LEVANTE/RegisterUsers.vue index bf56c997c..0673b06c9 100644 --- a/src/pages/LEVANTE/RegisterUsers.vue +++ b/src/pages/LEVANTE/RegisterUsers.vue @@ -318,7 +318,7 @@ async function submitUsers() { toast.add({ severity: 'error', - summary: 'User Creation Failure: ' + error.message, + summary: 'Error registering users: ' + error.message, life: 9000, });