bug fixes, half-finished admin ui, and a more

This commit is contained in:
Zoe
2024-09-23 01:21:28 -05:00
parent 6e6bc1c45b
commit 66f8437351
35 changed files with 1039 additions and 141 deletions

View File

@@ -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>