only use hourly table, remove daily table logic, fix updatechart undefined

This commit is contained in:
Francis Cao
2024-07-23 22:35:11 -07:00
parent 038ecdb592
commit 174b9e4376
10 changed files with 38 additions and 166 deletions

View File

@@ -56,7 +56,7 @@ export default async (
await useAuth(req, res);
await useValidate(schema, req, res);
const { websiteId, compare, unit } = req.query;
const { websiteId, compare } = req.query;
if (req.method === 'GET') {
if (!(await canViewWebsite(req.auth, websiteId))) {
@@ -72,13 +72,13 @@ export default async (
const filters = getRequestFilters(req);
const metrics = await getWebsiteStats(websiteId, unit as string, {
const metrics = await getWebsiteStats(websiteId, {
...filters,
startDate,
endDate,
});
const prevPeriod = await getWebsiteStats(websiteId, unit as string, {
const prevPeriod = await getWebsiteStats(websiteId, {
...filters,
startDate: compareStartDate,
endDate: compareEndDate,