Ordner-Tabelle: Fehlerbehandlung und Nachladen wenn leer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user