Error handling in Admin-Queries (loading bleibt nicht hängen)
This commit is contained in:
parent
c7d4d5ae81
commit
ea7a48a995
3 changed files with 46 additions and 31 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue