diff --git a/app/(private)/Alta/page.tsx b/app/(private)/Alta/page.tsx index a90117a..0ad2646 100644 --- a/app/(private)/Alta/page.tsx +++ b/app/(private)/Alta/page.tsx @@ -2,13 +2,19 @@ import RegisterAlta from "@/app/Components/Alta/registerAlta"; import "./style.css"; -export default async function Page(props: { searchParams?: Promise<{}> }) { +export default async function Page(props: { + searchParams?: Promise<{ + numAcount: string; + }>; +}) { const params = await props.searchParams; + const numAcount = params?.numAcount ? params.numAcount : null; + return (

ALTA USUARIO

- +
); } diff --git a/app/Components/Alta/registerAlta.tsx b/app/Components/Alta/registerAlta.tsx index b1796ca..b15cd5d 100644 --- a/app/Components/Alta/registerAlta.tsx +++ b/app/Components/Alta/registerAlta.tsx @@ -4,23 +4,29 @@ import apiClient from "@/app/lib/apiClient"; import "./registerAlta.css"; import toast from "react-hot-toast"; +import { useRouter } from "next/navigation"; type Carrera = { id_carrera: number; carrera: string; }; -export default function RegisterAlta() { +interface urlProp { + numCount: string | null; +} + +export default function RegisterAlta(props: urlProp) { + const router = useRouter(); const [listMajor, setListMajor] = useState([]); const [saved, setSaved] = useState(false); const [form, setForm] = useState({ - cuenta: "", + cuenta: String(props.numCount), nombre: "", apellidoP: "", apellidoM: "", fecha: "", - email: "", + email: `${props.numCount}@pcpuma.acatlan.unam.mx`, genero: "", carrera: "", }); @@ -52,7 +58,6 @@ export default function RegisterAlta() { (value) => value.trim() !== "", ); - const handleSave = async (e: React.MouseEvent) => { e.preventDefault(); @@ -68,7 +73,7 @@ export default function RegisterAlta() { const handleInscripcion = (e: React.MouseEvent) => { e.preventDefault(); - toast.success("Continuar con inscripción"); + router.push("/Inscripcion"); }; return ( @@ -81,6 +86,7 @@ export default function RegisterAlta() { value={form.cuenta} onChange={handleChange} placeholder="Coloca un número de cuenta..." + required /> @@ -92,6 +98,7 @@ export default function RegisterAlta() { value={form.nombre} onChange={handleChange} placeholder="Coloca el nombre" + required /> @@ -103,6 +110,7 @@ export default function RegisterAlta() { value={form.apellidoP} onChange={handleChange} placeholder="Coloca el apellido paterno" + required /> @@ -114,6 +122,7 @@ export default function RegisterAlta() { value={form.apellidoM} onChange={handleChange} placeholder="Coloca el apellido materno" + required /> @@ -124,6 +133,7 @@ export default function RegisterAlta() { name="fecha" value={form.fecha} onChange={handleChange} + required /> @@ -140,17 +150,17 @@ export default function RegisterAlta() {
- - - - + + +
- {listMajor.map((c) => (