diff --git a/src/app/(Administrador)/crearCuenta/page.tsx b/src/app/(Administrador)/crearCuenta/page.tsx index 5cd4415..b3cc2c2 100644 --- a/src/app/(Administrador)/crearCuenta/page.tsx +++ b/src/app/(Administrador)/crearCuenta/page.tsx @@ -1,8 +1,8 @@ "use client"; import { useState } from "react"; -import "../styles/layout/login.scss"; // puedes usar los mismos estilos -import "../styles/base/globales.scss"; +import "../../styles/layout/login.scss"; +import "../../styles/base/globales.scss"; import Link from "next/link"; import axios from "axios"; @@ -29,23 +29,21 @@ function CrearCuenta() { 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/register`, + // { + // nombre, + // correo, + // contraseña: password, + // } + // ); toast.success("Cuenta creada correctamente"); router.push("/"); // redirige al login } catch (err: unknown) { if (axios.isAxiosError(err)) { if (err.response) { - toast.error( - err.response.data?.message || "Error al crear la cuenta" - ); + toast.error(err.response.data?.message || "Error al crear la cuenta"); } else if (err.request) { toast.error("No se pudo conectar con el servidor"); } else { @@ -57,7 +55,6 @@ function CrearCuenta() { } finally { setLoading(false); } - }; return ( @@ -116,9 +113,7 @@ function CrearCuenta() { ¿Ya tienes cuenta? Inicia sesión - - ); } -export default CrearCuenta; \ No newline at end of file +export default CrearCuenta; diff --git a/src/app/(Administrador)/forgotPassword/page.tsx b/src/app/(Administrador)/forgotPassword/page.tsx index 98e3cf1..ff68644 100644 --- a/src/app/(Administrador)/forgotPassword/page.tsx +++ b/src/app/(Administrador)/forgotPassword/page.tsx @@ -4,7 +4,8 @@ import { useState } from "react"; import axios from "axios"; import { useRouter } from "next/navigation"; import toast from "react-hot-toast"; -import "../styles/base/globales.scss"; // ajusta ruta si tu proyecto la tiene en otro sitio +import "../../styles/base/globales.scss"; // ajusta ruta si tu proyecto la tiene en otro sitio +import Link from "next/link"; export default function ForgotPasswordPage() { const [email, setEmail] = useState(""); @@ -26,27 +27,38 @@ export default function ForgotPasswordPage() { setLoading(true); const res = await axios.post("/api/auth/forgot-password", { email }); if (res.status === 200) { - toast.success("Si existe esa cuenta, recibirás un correo con instrucciones."); + toast.success( + "Si existe esa cuenta, recibirás un correo con instrucciones." + ); // Opcional: redirigir al login después de enviar setTimeout(() => router.push("/"), 1200); } else { toast.error("Ocurrió un error. Intenta de nuevo."); } - } catch (error:any ) { + } catch (error) { // manejar mensajes de error desde el servidor si vienen - const msg = error?.response?.data?.message ?? "Error al enviar el correo."; - toast.error(msg); + console.log(error); } finally { setLoading(false); } }; return ( -
+

¿Olvidaste tu contraseña?

-

Escribe el correo asociado a tu cuenta y te enviaremos instrucciones para restablecerla.

+

+ Escribe el correo asociado a tu cuenta y te enviaremos instrucciones + para restablecerla. +

-
+ setEmail(e.target.value)} placeholder="tu@correo.com" required - style={{ padding: "0.6rem", borderRadius: 8, border: "1px solid #ccc" }} + style={{ + padding: "0.6rem", + borderRadius: 8, + border: "1px solid #ccc", + }} />
- Recordé mi contraseña — Iniciar sesión + Recordé mi contraseña — Iniciar sesión
diff --git a/src/app/(Operador)/AgregarEquipo/page.tsx b/src/app/(Operador)/AgregarEquipo/page.tsx index 2b75611..997b2ea 100644 --- a/src/app/(Operador)/AgregarEquipo/page.tsx +++ b/src/app/(Operador)/AgregarEquipo/page.tsx @@ -107,6 +107,7 @@ export default function Page() { setTiposEquipo(tiposEquipoRes.data); setSistemasOperativos(sistemasOperativosRes.data); setProcesadores(procesadoresRes.data); + console.log(adscripciones); } catch (err) { if (axios.isAxiosError(err)) { if (err.response) { diff --git a/src/app/(Operador)/Escaner/page.tsx b/src/app/(Operador)/Escaner/page.tsx index 44d201e..67af875 100644 --- a/src/app/(Operador)/Escaner/page.tsx +++ b/src/app/(Operador)/Escaner/page.tsx @@ -27,7 +27,7 @@ export default function Dashboard() { toast.error("Equipo no encontrado"); } } catch (error) { - toast.error("Equipo no encontrado"); + toast.error(`Equipo no encontrado,${error}`); } }; diff --git a/src/app/login/Login.tsx b/src/app/login/Login.tsx index a87dc51..13dec2d 100644 --- a/src/app/login/Login.tsx +++ b/src/app/login/Login.tsx @@ -4,7 +4,6 @@ import { useState } from "react"; import "../styles/layout/login.scss"; import "../styles/base/globales.scss"; import Image from "next/image"; -import Link from "next/link"; import axios from "axios"; import { useRouter } from "next/navigation"; import toast from "react-hot-toast";