Fix: tenantId via explizitem user-Fetch statt authStore.record
This commit is contained in:
parent
ea7a48a995
commit
f8b82a3cff
3 changed files with 8 additions and 3 deletions
|
|
@ -17,7 +17,10 @@
|
|||
try {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const tenantId = (pb.authStore.record as any)?.tenant;
|
||||
|
||||
// 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;
|
||||
|
||||
const result = await pb.collection('check_logs').getList(1, 50, {
|
||||
filter: `tenant = "${tenantId}" && created >= "${today.toISOString()}"`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue