Add link and pixel selectors to top nav
This commit is contained in:
1 parent
dd2d6bca45
commit
a1f3ad89f6
6 files changed
+255
-17
No files matched your search
@@ -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