mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Progress check-in.
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
This commit is contained in:
parent
5ce1b40330
commit
d227bc369f
11 changed files with 519 additions and 143 deletions
17
src/components/hooks/queries/useBoardQuery.ts
Normal file
17
src/components/hooks/queries/useBoardQuery.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
|
||||
export function useBoardQuery(boardId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
const { modified } = useModified(`board:${boardId}`);
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['boards', { boardId, modified }],
|
||||
queryFn: () => get(`/boards/${boardId}`),
|
||||
enabled: !!boardId && boardId !== 'create',
|
||||
placeholderData: keepPreviousData,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue