feat: update alumno registration to include telefono and curso_id, rename button to 'Registrar'

This commit is contained in:
BenitoBB 2025-05-14 10:17:09 -06:00
parent 30b07db07e
commit 1ea33d7097
2 changed files with 4 additions and 4 deletions

View File

@ -154,7 +154,7 @@ export default function AlumnosManual() {
type="submit"
className="bg-green-400 hover:bg-green-500 font-bold py-2 px-4 rounded-md text-black"
>
Guardar
Registrar
</Button>
</form>
</div>

View File

@ -8,14 +8,14 @@ export default async function handler(req, res) {
try {
const supabase = createClient({ req, res });
const { nombre, correo, nombreCurso } = req.body;
const { nombre, correo, telefono, curso_id } = req.body;
if (!nombre || !correo || !nombreCurso) {
if (!nombre || !correo || !telefono || !curso_id) {
return res.status(400).json({ error: "Faltan datos del alumno" });
}
const { data, error } = await supabase.from("alumno").insert([
{ nombre, correo, nombreCurso },
{ nombre, correo, telefono, curso_id },
]);
if (error) {