Merge branch 'Sarabia' of https://github.com/jls846/front-censo into Lino
This commit is contained in:
Generated
+28
@@ -11,6 +11,7 @@
|
||||
"@ericblade/quagga2": "^1.8.4",
|
||||
"@zxing/library": "^0.21.3",
|
||||
"axios": "^1.13.1",
|
||||
"axios": "^1.13.1",
|
||||
"next": "15.5.6",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0"
|
||||
@@ -2221,6 +2222,33 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.1.tgz",
|
||||
"integrity": "sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.4",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/axios/node_modules/form-data": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
|
||||
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"es-set-tostringtag": "^2.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.1.tgz",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user