Add MAX_PAGING_RESULTS on hooks for performance improvements.
This commit is contained in:
1 parent
a8c1f26775
commit
fbac7518fc
17 files changed
+74
-215
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { MAX_PAGING_RESULTS } from '@/lib/constants';
|
||||
import { serializeEventPropertyFilters } from '@/lib/params';
|
||||
import type { EventPropertyFilter, ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
@@ -28,6 +29,7 @@ export function useEventDataPivotQuery(
|
||||
timezone,
|
||||
...serializeEventPropertyFilters(eventFilters),
|
||||
...params,
|
||||
maxResults: MAX_PAGING_RESULTS,
|
||||
}),
|
||||
enabled: !!(websiteId && eventName),
|
||||
...options,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MAX_PAGING_RESULTS } from '@/lib/constants';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
@@ -24,7 +25,7 @@ export function useReplaysQuery(websiteId: string, params?: Record<string, strin
|
||||
...filters,
|
||||
...pageParams,
|
||||
...params,
|
||||
pageSize: 20,
|
||||
maxResults: MAX_PAGING_RESULTS,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MAX_PAGING_RESULTS } from '@/lib/constants';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
@@ -29,7 +30,7 @@ export function useRevenueSessionsQuery(
|
||||
...filters,
|
||||
...pageParams,
|
||||
...params,
|
||||
pageSize: 20,
|
||||
maxResults: MAX_PAGING_RESULTS,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -11,7 +11,6 @@ export function useSavedReplaysQuery(websiteId: string) {
|
||||
queryFn: pageParams => {
|
||||
return get(`/websites/${websiteId}/replays/saved`, {
|
||||
...pageParams,
|
||||
pageSize: 20,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MAX_PAGING_RESULTS } from '@/lib/constants';
|
||||
import { serializePropertyFilters } from '@/lib/params';
|
||||
import type { PropertyFilter, ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
@@ -28,6 +29,7 @@ export function useSessionDataPivotQuery(
|
||||
propertyName,
|
||||
...serializePropertyFilters(propertyFilters),
|
||||
...params,
|
||||
maxResults: MAX_PAGING_RESULTS,
|
||||
}),
|
||||
enabled: !!(websiteId && propertyName),
|
||||
...options,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MAX_PAGING_RESULTS } from '@/lib/constants';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
@@ -32,6 +33,7 @@ export function useWebsiteEventsQuery(
|
||||
...filters,
|
||||
...pageParams,
|
||||
eventType: EVENT_TYPES[params.view],
|
||||
maxResults: MAX_PAGING_RESULTS,
|
||||
}),
|
||||
enabled: !!websiteId,
|
||||
...options,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MAX_PAGING_RESULTS } from '@/lib/constants';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
@@ -27,7 +28,7 @@ export function useWebsiteSessionsQuery(
|
||||
...filters,
|
||||
...pageParams,
|
||||
...params,
|
||||
pageSize: 20,
|
||||
maxResults: MAX_PAGING_RESULTS,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user