add API on crearCueenta

This commit is contained in:
jls846
2025-11-20 18:49:56 -06:00
parent 909530f858
commit 18401808cb
2 changed files with 11 additions and 11 deletions
+10 -10
View File
@@ -24,8 +24,8 @@ export default function Page() {
async function CrearCuenta() {
const res=await axios.post("https",{
nombre,
correo,
password
contraseña:password,
tipoUsuario:2
});
setCrearCuenta(res.data);
}
@@ -42,14 +42,14 @@ export default function Page() {
setLoading(true);
try {
// const response = await axios.post(
// `${process.env.NEXT_PUBLIC_API_URL}/auth/register`,
// {
// nombre,
// correo,
// contraseña: password,
// }
// );
const response = await axios.post(
`${process.env.NEXT_PUBLIC_API_URL}/auth/registro`,
{
nombre,
contraseña: password,
tipoUsuario: 2,
}
);
toast.success("Cuenta creada correctamente");
router.push("/"); // redirige al login
+1 -1
View File
@@ -27,7 +27,7 @@ const CATEGORIA_MAP: Record<string, { tabla: number; so: string }> = {
"ESCRITORIO LINUX": { tabla: 0, so: "Linux" },
"PORTÁTILES WINDOWS": { tabla: 2, so: "Windows" },
"PORTÁTILES MAC OS": { tabla: 2, so: "Mac OS" },
"TABLETA IPAD OS": { tabla: 1, so: "Mac OS" },
"TABLETA iPAD OS": { tabla: 1, so: "Mac OS" },
"SERVIDOR": { tabla: 3, so: "Linux" },
};