mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Split out session query.
This commit is contained in:
parent
7b9c29e039
commit
4497951000
9 changed files with 139 additions and 56 deletions
|
|
@ -68,7 +68,7 @@ export default async (
|
|||
|
||||
filters[type] = undefined;
|
||||
|
||||
let data = await getSessionMetrics(websiteId, {
|
||||
const data = await getSessionMetrics(websiteId, {
|
||||
startDate,
|
||||
endDate,
|
||||
column,
|
||||
|
|
@ -88,7 +88,7 @@ export default async (
|
|||
}
|
||||
}
|
||||
|
||||
data = Object.values(combined);
|
||||
return ok(res, Object.values(combined));
|
||||
}
|
||||
|
||||
return ok(res, data);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { canViewWebsite } from 'lib/auth';
|
|||
import { useAuth, useCors } from 'lib/middleware';
|
||||
import { getPageviewStats } from 'queries';
|
||||
import { parseDateRangeQuery } from 'lib/query';
|
||||
import { getSessionStats } from '../../../../queries/analytics/sessions/getSessionStats';
|
||||
|
||||
export interface WebsitePageviewRequestQuery {
|
||||
id: string;
|
||||
|
|
@ -62,7 +63,6 @@ export default async (
|
|||
endDate,
|
||||
timezone,
|
||||
unit,
|
||||
count: '*',
|
||||
filters: {
|
||||
url,
|
||||
referrer,
|
||||
|
|
@ -75,14 +75,14 @@ export default async (
|
|||
city,
|
||||
},
|
||||
}),
|
||||
getPageviewStats(websiteId, {
|
||||
getSessionStats(websiteId, {
|
||||
startDate,
|
||||
endDate,
|
||||
timezone,
|
||||
unit,
|
||||
count: 'distinct website_event.',
|
||||
filters: {
|
||||
url,
|
||||
referrer,
|
||||
title,
|
||||
os,
|
||||
browser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue