Merge branch 'dev' into session-recording
This commit is contained in:
commit
d349c3aea9
381 files changed
+24834
-139358
No files matched your search
@@ -3,14 +3,21 @@ import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useBoardsQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
export function useBoardsQuery(
|
||||
{ teamId }: { teamId?: string },
|
||||
params?: Record<string, any>,
|
||||
options?: ReactQueryOptions,
|
||||
) {
|
||||
const { modified } = useModified('boards');
|
||||
const { get } = useApi();
|
||||
|
||||
return usePagedQuery({
|
||||
queryKey: ['boards', { teamId, modified }],
|
||||
queryKey: ['boards', { teamId, modified, ...params }],
|
||||
queryFn: pageParams => {
|
||||
return get(teamId ? `/teams/${teamId}/boards` : '/boards', pageParams);
|
||||
return get(teamId ? `/teams/${teamId}/boards` : '/boards', {
|
||||
...pageParams,
|
||||
...params,
|
||||
});
|
||||
},
|
||||
...options,
|
||||
});
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
@@ -3,14 +3,21 @@ import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useLinksQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
export function useLinksQuery(
|
||||
{ teamId }: { teamId?: string },
|
||||
params?: Record<string, any>,
|
||||
options?: ReactQueryOptions,
|
||||
) {
|
||||
const { modified } = useModified('links');
|
||||
const { get } = useApi();
|
||||
|
||||
return usePagedQuery({
|
||||
queryKey: ['links', { teamId, modified }],
|
||||
queryKey: ['links', { teamId, modified, ...params }],
|
||||
queryFn: pageParams => {
|
||||
return get(teamId ? `/teams/${teamId}/links` : '/links', pageParams);
|
||||
return get(teamId ? `/teams/${teamId}/links` : '/links', {
|
||||
...pageParams,
|
||||
...params,
|
||||
});
|
||||
},
|
||||
...options,
|
||||
});
|
||||
|
||||
@@ -3,14 +3,21 @@ import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function usePixelsQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
export function usePixelsQuery(
|
||||
{ teamId }: { teamId?: string },
|
||||
params?: Record<string, any>,
|
||||
options?: ReactQueryOptions,
|
||||
) {
|
||||
const { modified } = useModified('pixels');
|
||||
const { get } = useApi();
|
||||
|
||||
return usePagedQuery({
|
||||
queryKey: ['pixels', { teamId, modified }],
|
||||
queryKey: ['pixels', { teamId, modified, ...params }],
|
||||
queryFn: pageParams => {
|
||||
return get(teamId ? `/teams/${teamId}/pixels` : '/pixels', pageParams);
|
||||
return get(teamId ? `/teams/${teamId}/pixels` : '/pixels', {
|
||||
...pageParams,
|
||||
...params,
|
||||
});
|
||||
},
|
||||
...options,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user