Commit fb2d919f authored by Adrian's avatar Adrian
Browse files

cambios

parent c08bfb4f
......@@ -18,7 +18,7 @@
document.getElementById('login').style.display = 'none';
document.getElementById('data').style.display = 'block';
} else {
alert('Datos incorrectos');
alert('Credenciales incorrectas');
}
});
}
......@@ -29,6 +29,7 @@
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Authorization': 'Bearer ' + window.localStorage.getItem('site_token'),
'Content-Type': 'application/json'
},
redirect: 'follow',
......@@ -43,7 +44,15 @@
text: document.querySelector('#description').value
})
.then((data) => {
alert('Mensaje enviado');
if (data.finalizado) {
document.querySelector('#title').value = '';
document.querySelector('#description').value = '';
alert('Mensaje enviado');
} else {
alert('El token expiro, por favor vuelva a loguearse');
document.getElementById('login').style.display = 'block';
document.getElementById('data').style.display = 'none';
}
});
}
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment