mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Website components. Update chart component.
This commit is contained in:
parent
d81ee3932d
commit
bdcdcd9d13
9 changed files with 165 additions and 43 deletions
|
|
@ -4,11 +4,11 @@ import { useAuth } from 'lib/middleware';
|
|||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { id, start_at, end_at, tz } = req.query;
|
||||
const { id, start_at, end_at, unit, tz } = req.query;
|
||||
|
||||
const [pageviews, uniques] = await Promise.all([
|
||||
getPageviewData(+id, new Date(+start_at), new Date(+end_at), tz, 'day', '*'),
|
||||
getPageviewData(+id, new Date(+start_at), new Date(+end_at), tz, 'day', 'distinct session_id'),
|
||||
getPageviewData(+id, new Date(+start_at), new Date(+end_at), tz, unit, '*'),
|
||||
getPageviewData(+id, new Date(+start_at), new Date(+end_at), tz, unit, 'distinct session_id'),
|
||||
]);
|
||||
|
||||
res.status(200).json({ pageviews, uniques });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue