From 579f6f7a3440c18fb3c0047efdf5853bbcf8b108 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Oct 2026 07:05:58 -0600 Subject: [PATCH] feat: add optional email field to parent registration form --- public/index.html | 5 +++++ public/js/app.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 54f29ee..fd4974c 100644 --- a/public/index.html +++ b/public/index.html @@ -74,6 +74,11 @@ +
+ + +
+
diff --git a/public/js/app.js b/public/js/app.js index 16b87ea..8e046ab 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -173,6 +173,8 @@ async function handleRegisterPadreSubmit(event) { if (event) event.preventDefault(); const nombre = document.getElementById('regNombre').value.trim(); const telefono = document.getElementById('regTelefono').value.trim(); + const emailInput = document.getElementById('regEmail'); + const email = emailInput ? emailInput.value.trim() : ''; const username = document.getElementById('regUsername').value.trim(); const password = document.getElementById('regPassword').value.trim(); const errorMsg = document.getElementById('registerErrorMsg'); @@ -186,7 +188,7 @@ async function handleRegisterPadreSubmit(event) { const res = await fetch('/api/auth/register-padre', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ nombre, telefono, username, password }) + body: JSON.stringify({ nombre, telefono, email, username, password }) }); const data = await res.json(); if (!res.ok) throw new Error(data.error || 'Error al registrar la cuenta');