mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
DropDown component. Renamed files.
This commit is contained in:
parent
ff4492ffb5
commit
9f112c8cc9
16 changed files with 149 additions and 48 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { getSummary } from 'lib/db';
|
||||
import { getMetrics } from 'lib/db';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
|
|
@ -6,14 +6,14 @@ export default async (req, res) => {
|
|||
|
||||
const { id, start_at, end_at } = req.query;
|
||||
|
||||
const summary = await getSummary(
|
||||
const metrics = await getMetrics(
|
||||
+id,
|
||||
new Date(+start_at).toISOString(),
|
||||
new Date(+end_at).toISOString(),
|
||||
);
|
||||
|
||||
const stats = Object.keys(summary[0]).reduce((obj, key) => {
|
||||
obj[key] = +summary[0][key];
|
||||
const stats = Object.keys(metrics[0]).reduce((obj, key) => {
|
||||
obj[key] = +metrics[0][key];
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue