Commit 12b7e7e9 by Yvon Kerdoncuff

stock movement : simply show exception error on page

parent 26f9cbd8
......@@ -718,20 +718,16 @@ function do_stock_movement() {
closeModal();
reset_focus();
let could_not_reserve_error = "Failed api execute : <Fault 2: \"Could not reserve all requested products. Please use the 'Mark as Todo' button to handle the reservation manually.\">";
if(data.responseJSON.errors.length > 0
&& data.responseJSON.errors[0] == could_not_reserve_error) {
$.notify("Erreur lors de l'opération : échec de la réservation d'un produit.", {
globalPosition:"top right",
className: "error"
});
} else {
$.notify("Erreur lors de l'opération.", {
let error_text_displayed = "Erreur lors de l'opération";
if(data.responseJSON.errors.length > 0) {
error_text_displayed += " : " + data.responseJSON.errors[0]
}
error_text_displayed += ".";
$.notify(error_text_displayed, {
globalPosition:"top right",
className: "error"
});
}
}
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment