Proper error handling for node type editor

This commit is contained in:
2018-02-01 14:13:01 +01:00
parent 284873ddd4
commit 1ca2f336c4
2 changed files with 17 additions and 6 deletions

View File

@@ -82,13 +82,14 @@ script.
var data = $node_type_form.serialize();
$.post(url, data, function(datata) {
})
$.post(url, data)
.done(function(){
toastr.success("Node Type: {{ node_type['name'] | undertitle }}", "Saved")
})
.fail(function(){
toastr.error("Node Type: {{ node_type['name'] | undertitle }}", "Could not save")
.fail(function(err) {
toastr.error(
xhrErrorResponseMessage(err),
"Could not save {{ node_type['name'] | undertitle }}")
});
});
});