1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-21 18:47:39 +00:00

Improved error handling on mass edit list

This commit is contained in:
Ozzie Isaacs
2024-12-29 20:12:27 +01:00
parent 32d120bd39
commit 928ed10c2e
3 changed files with 114 additions and 42 deletions

View File

@@ -220,7 +220,8 @@ $(function() {
"comments": $("#comments_input").val().toString(),
"checkA": $('#autoupdate_authorsort').prop('checked').toString()
}),
success: function success(booTitles) {
success: function success(data) {
let result = "";
$("#books-table").bootstrapTable("refresh");
$("#books-table").bootstrapTable("uncheckAll");
@@ -234,7 +235,23 @@ $(function() {
$("#publishers_input").val("");
$("#comments_input").val("");
handleListServerResponse;
$("#flash_success").remove();
$("#flash_danger").remove();
if (!jQuery.isEmptyObject(data)) {
data.forEach(function(item) {
if (item.success === true) {
result = "success";
} else {
result = "danger";
}
$(".navbar").after('<div class="row-fluid text-center">' +
'<div id="flash_' + result + '" class="alert alert-' + result + '">' + item.msg + '</div>' +
'</div>');
});
}
$(".table.table-striped").bootstrapTable("refresh");
// handleListServerResponse(data);
}
});
});