bug fixes, half-finished admin ui, and a more
This commit is contained in:
@@ -13,6 +13,7 @@ let password = ref('')
|
||||
|
||||
let error = ref('')
|
||||
|
||||
let timeout;
|
||||
const submitForm = async () => {
|
||||
let { data, error: fetchError } = await useAsyncData<User, NuxtError<{ message: string }>>(
|
||||
() => $fetch('/api/signup', {
|
||||
@@ -27,12 +28,16 @@ const submitForm = async () => {
|
||||
|
||||
if (fetchError.value != null && fetchError.value.data !== undefined) {
|
||||
error.value = fetchError.value.data.message
|
||||
setTimeout(() => error.value = "", 15000)
|
||||
timeout = setTimeout(() => error.value = "", 15000)
|
||||
} else if (data.value !== null) {
|
||||
setUser(data.value)
|
||||
await navigateTo('/home')
|
||||
}
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
clearTimeout(timeout)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user