mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Details page.
This commit is contained in:
parent
5b45301178
commit
ac2612924e
12 changed files with 312 additions and 10 deletions
|
|
@ -2,12 +2,14 @@ import moment from 'moment-timezone';
|
|||
import { getPageviewData } from 'lib/db';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
const unitTypes = ['month', 'hour', 'day'];
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { id, start_at, end_at, unit, tz } = req.query;
|
||||
|
||||
if (!moment.tz.zone(tz) || !['month', 'hour', 'day'].includes(unit)) {
|
||||
if (!moment.tz.zone(tz) || !unitTypes.includes(unit)) {
|
||||
return res.status(400).end();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue