This commit is contained in:
kek7198 2022-01-03 16:06:36 -06:00
parent 1214f90ba4
commit 2912afe2a0
2 changed files with 4 additions and 4 deletions

View file

@ -255,13 +255,11 @@ function submitFormAjax(e, success, error) {
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
myToast.show();
// Run success function
success()
if (success) success()
return true
} else if (xhr.status >= 300 && xhr.status < 400) {
window.location.href = JSON.parse(xhr.response)["redirect"]
} else {
// Run error function
error()
try {
data=JSON.parse(xhr.response);
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
@ -275,6 +273,8 @@ function submitFormAjax(e, success, error) {
myToast.show();
return false
}
// Run error function
if (error) error()
}
};