add API on crearCueenta
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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" },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user