mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Boards components.
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
7edddf15a7
commit
a39ebffd8b
20 changed files with 450 additions and 33 deletions
17
src/components/hooks/queries/useBoardsQuery.ts
Normal file
17
src/components/hooks/queries/useBoardsQuery.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useBoardsQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
const { modified } = useModified('boards');
|
||||
const { get } = useApi();
|
||||
|
||||
return usePagedQuery({
|
||||
queryKey: ['boards', { teamId, modified }],
|
||||
queryFn: pageParams => {
|
||||
return get(teamId ? `/teams/${teamId}/boards` : '/boards', pageParams);
|
||||
},
|
||||
...options,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue