This introduces a user-scoped dashboard with board-style view/edit pages while keeping it unavailable in team context, and moves website targeting to component config so dashboard components can each select their own website.
17 lines
512 B
TypeScript
17 lines
512 B
TypeScript
import { keepPreviousData } from '@tanstack/react-query';
|
|
import type { ReactQueryOptions } from '@/lib/types';
|
|
import { useApi } from '../useApi';
|
|
import { useModified } from '../useModified';
|
|
|
|
export function useDashboardQuery(options?: ReactQueryOptions) {
|
|
const { get, useQuery } = useApi();
|
|
const { modified } = useModified('dashboard');
|
|
|
|
return useQuery({
|
|
queryKey: ['dashboard', { modified }],
|
|
queryFn: () => get('/dashboard'),
|
|
placeholderData: keepPreviousData,
|
|
...options,
|
|
});
|
|
}
|