Ordner-Tabelle: Fehlerbehandlung und Nachladen wenn leer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kroonk
2026-04-16 22:17:52 +02:00
parent 2c040b651d
commit 43539fa1a3
2 changed files with 24 additions and 6 deletions

View File

@@ -160,11 +160,29 @@ $(document).ready(function() {
assignedFolders = [];
return;
}
$.get('/api/admin/assign?user_id=' + uid).done(function(folders) {
assignedFolders = folders || [];
renderFolderTable();
$('#folder-table-wrap').show();
});
// Ordner neu laden falls noch leer, dann Zuweisung anzeigen
var showTable = function() {
$.get('/api/admin/assign?user_id=' + uid).done(function(folders) {
assignedFolders = folders || [];
renderFolderTable();
$('#folder-table-wrap').show();
}).fail(function() {
assignedFolders = [];
renderFolderTable();
$('#folder-table-wrap').show();
});
};
if (allFolders.length === 0) {
$.get('/api/admin/folders').done(function(folders) {
allFolders = folders || [];
showTable();
}).fail(function() {
allFolders = [];
showTable();
});
} else {
showTable();
}
});
// Klick auf Ordner-Zeile: Toggle + sofort speichern