Merge branch 'Sarabia' of https://github.com/jls846/front-censo into Lino

This commit is contained in:
2025-10-28 14:45:39 -06:00
3 changed files with 47 additions and 2 deletions
+5
View File
@@ -33,7 +33,12 @@ export default function Dashboard() {
if (encontrado) {
router.push(`/Editar?equipoId=${encontrado.id}`);
} else {
<<<<<<< HEAD
router.push(`/AgregarEquipo?equipoId=${code}`);
=======
// 🚫 Si no existe, se puede registrar
router.push(`/AgregarEquipo`);
>>>>>>> 8457542e8b63924894ebfa2f3148c3bc24a14a59
}
};
+14 -2
View File
@@ -5,15 +5,27 @@ import "../app/styles/layout/login.scss";
import "../app/styles/base/globales.scss";
import Image from "next/image";
import Link from "next/link";
import axios from "axios";
export default function Login() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
// Autenticacion simulada
setError("");
setLoading(true);
try{
const response = await axios.post('/api/login', { email, password });
} catch (err) {
console.error("Error en la solicitud:", err);
setError("Error al conectar con el servidor");
} finally {
setLoading(false);
}
};
return (