chore: refine report filters and access gating
This commit is contained in:
parent
52c03ff1cf
commit
6938bebdbb
3 changed files with 6 additions and 5 deletions
|
|
@ -38,7 +38,8 @@ export function MachineCategoryReport() {
|
|||
const { session, convexUserId, isStaff } = useAuth()
|
||||
const tenantId = session?.user.tenantId ?? DEFAULT_TENANT_ID
|
||||
|
||||
const enabled = Boolean(isStaff && convexUserId)
|
||||
const canView = Boolean(isStaff)
|
||||
const enabled = Boolean(canView && convexUserId)
|
||||
|
||||
const data = useQuery(
|
||||
api.reports.ticketsByMachineAndCategory,
|
||||
|
|
@ -118,7 +119,7 @@ export function MachineCategoryReport() {
|
|||
[items]
|
||||
)
|
||||
|
||||
if (!enabled) {
|
||||
if (!canView) {
|
||||
return (
|
||||
<Card className="border-slate-200">
|
||||
<CardHeader>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue