mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-26 18:37:12 +00:00
add errMsg function
This commit is contained in:
parent
61b6aceb36
commit
49dd88dbb7
@ -28,7 +28,15 @@ function addMsg(msg, alert_type) {
|
|||||||
+ msg + "</div>\n";
|
+ msg + "</div>\n";
|
||||||
msgDiv.html(html);
|
msgDiv.html(html);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* add Muliple error message from err_obj
|
||||||
|
* @param err_obj {error_code:erro_message}
|
||||||
|
*/
|
||||||
|
function errMsg(errs_obj){
|
||||||
|
for (const err_msg of Object.values(errs_obj)) {
|
||||||
|
addMsg(err_msg,'danger');
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Reload the balance of the user on the right top corner
|
* Reload the balance of the user on the right top corner
|
||||||
*/
|
*/
|
||||||
|
@ -200,7 +200,6 @@ function consume(source, dest, quantity, amount, reason, type, category, templat
|
|||||||
"template": template
|
"template": template
|
||||||
}, reset).fail(function (e) {
|
}, reset).fail(function (e) {
|
||||||
reset();
|
reset();
|
||||||
|
errMsg(e.responseJSON);
|
||||||
addMsg("Une erreur est survenue lors de la transaction : " + e.responseText, "danger");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user