parent
4a42f46089
commit
c75f62f5e6
1 changed files with 6 additions and 1 deletions
|
@ -47,7 +47,12 @@
|
|||
body: JSON.stringify(object)
|
||||
}).then(res => {
|
||||
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) {
|
||||
document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Failure</span>";
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue