mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Merge branch 'analytics' into dev
This commit is contained in:
commit
b76f4aa42d
@ -26,7 +26,7 @@ export function useWebsitePageviews(websiteId: string, options?: { [key: string]
|
||||
};
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['websites:pageviews', params],
|
||||
queryKey: ['websites:pageviews', { websiteId, ...params }],
|
||||
queryFn: () => get(`/websites/${websiteId}/pageviews`, params),
|
||||
...options,
|
||||
});
|
||||
|
@ -23,7 +23,7 @@ export function useWebsiteStats(websiteId: string, options?: { [key: string]: st
|
||||
};
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['websites:stats', params],
|
||||
queryKey: ['websites:stats', { websiteId, ...params }],
|
||||
queryFn: () => get(`/websites/${websiteId}/stats`, params),
|
||||
...options,
|
||||
});
|
||||
|
@ -92,7 +92,7 @@ export function DateFilter({
|
||||
const handleClose = () => setShowPicker(false);
|
||||
|
||||
const renderValue = (value: string) => {
|
||||
const { unit } = parseDateValue(value);
|
||||
const { unit } = parseDateValue(value) || {};
|
||||
|
||||
if (offset && unit === 'year') {
|
||||
return formatDate(startDate, 'yyyy', locale);
|
||||
|
@ -260,7 +260,7 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) {
|
||||
|
||||
const change = num * increment;
|
||||
const { add } = DATE_FUNCTIONS[unit];
|
||||
const { unit: originalUnit } = parseDateValue(value);
|
||||
const { unit: originalUnit } = parseDateValue(value) || {};
|
||||
|
||||
switch (originalUnit) {
|
||||
case 'week':
|
||||
|
Loading…
Reference in New Issue
Block a user