fixing the redirect again

This commit is contained in:
Chris Cochrun 2022-12-20 15:06:00 -06:00
parent cba16088c5
commit db2209b7d1

View file

@ -52,16 +52,9 @@
}
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = (e) => {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status === 200) {
console.log('SUCCESS', xhr.responseText);
window.location.href = "/thankyou/";
} else {
console.warn('request_error', xhr.responseText);
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
window.location.href = '/thankyou/';
}
};
xhr.open("POST", "https://n8n.tfcconnection.org/webhook/health-form");