mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 01:25:37 +01:00
Fixed summary query.
This commit is contained in:
parent
0c8d9eacd3
commit
344ffeb658
6 changed files with 16 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { getSummary } from 'lib/db';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
import { format } from 'date-fns';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
|
@ -9,8 +8,8 @@ export default async (req, res) => {
|
|||
|
||||
const summary = await getSummary(
|
||||
+id,
|
||||
format(new Date(+start_at), 'yyyy-MM-dd hh:mm:ss'),
|
||||
format(new Date(+end_at), 'yyyy-MM-dd hh:mm:ss'),
|
||||
new Date(+start_at).toISOString(),
|
||||
new Date(+end_at).toISOString(),
|
||||
);
|
||||
|
||||
const stats = Object.keys(summary[0]).reduce((obj, key) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue