Enable public website sharing.

This commit is contained in:
Mike Cao 2020-08-15 01:17:15 -07:00
parent 48a524e09c
commit 560f1316c1
36 changed files with 294 additions and 61 deletions

View file

@ -1,13 +1,10 @@
import moment from 'moment-timezone';
import { getPageviews } from 'lib/queries';
import { useAuth } from 'lib/middleware';
import { ok, badRequest } from 'lib/response';
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) || !unitTypes.includes(unit)) {