Error handling in Admin-Queries (loading bleibt nicht hängen)

This commit is contained in:
rene 2026-05-17 13:38:32 +02:00
parent c7d4d5ae81
commit ea7a48a995
3 changed files with 46 additions and 31 deletions

View file

@ -19,16 +19,21 @@
async function loadPage(p: number) {
loading = true;
const tenantId = (pb.authStore.record as any)?.tenant;
const result = await pb.collection('check_logs').getList(p, PER_PAGE, {
filter: `tenant = "${tenantId}"`,
expand: 'station',
sort: '-created'
});
logs = result.items;
page = p;
totalPages = Math.ceil(result.totalItems / PER_PAGE);
loading = false;
try {
const tenantId = (pb.authStore.record as any)?.tenant;
const result = await pb.collection('check_logs').getList(p, PER_PAGE, {
filter: `tenant = "${tenantId}"`,
expand: 'station',
sort: '-created'
});
logs = result.items;
page = p;
totalPages = Math.ceil(result.totalItems / PER_PAGE);
} catch {
// Keine Einträge
} finally {
loading = false;
}
}
function formatDate(iso: string) {