parent
4a42f46089
commit
c75f62f5e6
1 changed files with 6 additions and 1 deletions
|
@ -47,7 +47,12 @@
|
||||||
body: JSON.stringify(object)
|
body: JSON.stringify(object)
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
document.getElementById('formStatus').innerHTML = "<span style='background-color: green; color: white'>Success</span>";
|
let temp = res.json();
|
||||||
|
if(temp.result === 'error'){
|
||||||
|
document.getElementById('formStatus').innerHTML = `<span style='background-color: red; color: white'>${temp.error}</span>`;
|
||||||
|
} else {
|
||||||
|
document.getElementById('formStatus').innerHTML = "<span style='background-color: green; color: white'>Success</span>";
|
||||||
|
}
|
||||||
} else if (res.status === 500) {
|
} else if (res.status === 500) {
|
||||||
document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Failure</span>";
|
document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Failure</span>";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue