Fix: PocketBase Filter braucht single quotes und kein ISO-T-Format

This commit is contained in:
rene 2026-05-17 14:01:07 +02:00
parent a3281261ab
commit b5cac0e12c
3 changed files with 4 additions and 5 deletions

View file

@ -21,14 +21,13 @@
// User-Record explizit laden damit tenant-Relation sicher gesetzt ist
const user = await pb.collection('users').getOne(pb.authStore.record!.id);
const tenantId = user.tenant;
console.log('[Dashboard] user:', user, 'tenantId:', tenantId);
const dateStr = today.toISOString().replace('T', ' ');
const result = await pb.collection('check_logs').getList(1, 50, {
filter: `created >= "${today.toISOString()}"`,
filter: `tenant = '${tenantId}' && created >= '${dateStr}'`,
expand: 'station',
sort: '-created'
});
console.log('[Dashboard] check_logs result:', result);
logs = result.items;
stats.total = result.totalItems;