Optimize API calls, added form loading logs

This commit is contained in:
Julien Nahum
2024-01-25 05:12:45 +01:00
parent eceaae17da
commit 2dbbc38ba4
6 changed files with 21 additions and 24 deletions

View File

@@ -92,6 +92,7 @@ const loadForm = async (setup=false) => {
if (setup) {
const {data, error} = await formsStore.publicLoad(slug)
if (error.value) {
console.error(`Error loading form [${slug}]:`,error.value)
formsStore.stopLoading()
return
}

View File

@@ -35,10 +35,7 @@ const deleteAccount = () => {
loading = false
useAlert().success(data.message)
// Log out the user.
await authStore.logout()
// Redirect to login.
authStore.logout()
router.push({ name: 'login' })
}).catch((error) => {
useAlert().error(error.data.message)