From 3951ce1d4e41b0177af9d171af421dad221f4f6f Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 8 Aug 2025 20:59:06 +0200 Subject: [PATCH] fixes --- pages/signup.vue | 72 +++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/pages/signup.vue b/pages/signup.vue index 7111e38..d908424 100644 --- a/pages/signup.vue +++ b/pages/signup.vue @@ -27,7 +27,8 @@ >({ - first_name: '', - last_name: '', - email: '', - phone: '', - date_of_birth: '', - address: '', - nationality: '' -}); +// Reactive data - Using individual refs to prevent Vue reactivity corruption +const firstName = ref(''); +const lastName = ref(''); +const email = ref(''); +const phone = ref(''); +const dateOfBirth = ref(''); +const address = ref(''); +const nationality = ref(''); + +// Computed property to create form object for submission +const form = computed(() => ({ + first_name: firstName.value, + last_name: lastName.value, + email: email.value, + phone: phone.value, + date_of_birth: dateOfBirth.value, + address: address.value, + nationality: nationality.value +})); const valid = ref(false); const loading = ref(false); @@ -346,16 +358,14 @@ async function submitRegistration() { if (response?.success) { successMessage.value = response.message || 'Registration successful!'; - // Reset form - form.value = { - first_name: '', - last_name: '', - email: '', - phone: '', - date_of_birth: '', - address: '', - nationality: '' - }; + // Reset form by resetting individual refs + firstName.value = ''; + lastName.value = ''; + email.value = ''; + phone.value = ''; + dateOfBirth.value = ''; + address.value = ''; + nationality.value = ''; recaptchaToken.value = ''; // Reset reCAPTCHA recaptcha.value?.reset();