minor fixes

This commit is contained in:
nikili0n
2023-09-25 23:22:10 +03:00
committed by Dantenerosas
parent 90207dd5a7
commit 89398ae5d1
2 changed files with 16 additions and 9 deletions

View File

@ -124,12 +124,18 @@
xhr.onload = () => {
document.forms.download.querySelector('[type="submit"]').disabled = false;
document.forms.download.querySelector('.submit-spinner').classList.add('submit-spinner_hide');
if (xhr.status !== 200) {
console.log(xhr.status);
if (xhr.status !== 200 && xhr.status !== 201) {
return;
}
};
const response = xhr.response;
result.innerHTML = xhr.response.result;
result.href = xhr.response.result;
console.log(response);
if (xhr.status === 201) {
sendReq()
}
}
xhr.onerror = () => {
document.forms.download.querySelector('[type="submit"]').disabled = false;
@ -138,7 +144,8 @@
document.forms.download.querySelector('[type="submit"]').disabled = true;
document.forms.download.querySelector('.submit-spinner').classList.remove('submit-spinner_hide');
xhr.send(new FormData(document.forms.download));
sendReq()
}
// при отправке формы