mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 00:55:37 +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,21 +0,0 @@
|
|||
import { getSummary } from 'lib/db';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { id, start_at, end_at } = req.query;
|
||||
|
||||
const summary = await getSummary(
|
||||
+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];
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
return res.status(200).json(stats);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue