refactor: use Convex skip sentinel in query args
This commit is contained in:
parent
3de7eccaa8
commit
bd2f22d046
32 changed files with 167 additions and 157 deletions
|
|
@ -50,13 +50,13 @@ export function HoursReport() {
|
|||
|
||||
const enabled = Boolean(isStaff && convexUserId)
|
||||
const data = useQuery(
|
||||
enabled ? api.reports.hoursByClient : undefined,
|
||||
enabled ? { tenantId, viewerId: convexUserId as Id<"users">, range: timeRange } : undefined
|
||||
api.reports.hoursByClient,
|
||||
enabled ? { tenantId, viewerId: convexUserId as Id<"users">, range: timeRange } : "skip"
|
||||
) as { rangeDays: number; items: HoursItem[] } | undefined
|
||||
|
||||
const companies = useQuery(
|
||||
enabled ? api.companies.list : undefined,
|
||||
enabled ? { tenantId, viewerId: convexUserId as Id<"users"> } : undefined
|
||||
api.companies.list,
|
||||
enabled ? { tenantId, viewerId: convexUserId as Id<"users"> } : "skip"
|
||||
) as Array<{ id: Id<"companies">; name: string }> | undefined
|
||||
const filtered = useMemo(() => {
|
||||
const items = data?.items ?? []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue