Corrección de ruta en la llamada al controlador

This commit is contained in:
victor.monge 2025-05-07 10:39:35 -06:00
parent e82ec89051
commit 074453eda8
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ formulario.addEventListener("submit", async (event) => {
data.append("contrasena", contrasena);
try {
const respuestaPeticion = await fetch("../controllers/LoginController.php", {
const respuestaPeticion = await fetch("controllers/LoginController.php", {
method: "POST",
body: data,
});
@ -24,7 +24,7 @@ formulario.addEventListener("submit", async (event) => {
window.location.href = 'views/inicio.html';
} else if(respuesta.estado === 'error') {
notificacion.textContent = respuesta.mensaje;
if(respuesta.res){
if(respuesta.res){ // Si existe respuesta.res hubo un error y se imprime en consola
console.error(respuesta.res)
}
notificacion.style.display = "block";