Corrección de ruta en la llamada al controlador
This commit is contained in:
parent
e82ec89051
commit
074453eda8
js
|
@ -13,7 +13,7 @@ formulario.addEventListener("submit", async (event) => {
|
||||||
data.append("contrasena", contrasena);
|
data.append("contrasena", contrasena);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const respuestaPeticion = await fetch("../controllers/LoginController.php", {
|
const respuestaPeticion = await fetch("controllers/LoginController.php", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: data,
|
body: data,
|
||||||
});
|
});
|
||||||
|
@ -24,7 +24,7 @@ formulario.addEventListener("submit", async (event) => {
|
||||||
window.location.href = 'views/inicio.html';
|
window.location.href = 'views/inicio.html';
|
||||||
} else if(respuesta.estado === 'error') {
|
} else if(respuesta.estado === 'error') {
|
||||||
notificacion.textContent = respuesta.mensaje;
|
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)
|
console.error(respuesta.res)
|
||||||
}
|
}
|
||||||
notificacion.style.display = "block";
|
notificacion.style.display = "block";
|
||||||
|
|
Loading…
Reference in New Issue