mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 01:25:37 +01:00
roll back id adds
This commit is contained in:
parent
ec6454aead
commit
4073d57e64
10 changed files with 14 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { getWebsiteStats, getWebsiteById } from 'queries';
|
||||
import { getWebsiteStats } from 'queries';
|
||||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||
import { allowQuery } from 'lib/auth';
|
||||
import { useCors } from 'lib/middleware';
|
||||
|
|
@ -14,7 +14,6 @@ export default async (req, res) => {
|
|||
const { website_id, start_at, end_at, url, referrer, os, browser, device, country } = req.query;
|
||||
|
||||
const websiteId = +website_id;
|
||||
let websiteUuid = (await getWebsiteById(websiteId)).websiteUuid;
|
||||
const startDate = new Date(+start_at);
|
||||
const endDate = new Date(+end_at);
|
||||
|
||||
|
|
@ -22,7 +21,7 @@ export default async (req, res) => {
|
|||
const prevStartDate = new Date(+start_at - distance);
|
||||
const prevEndDate = new Date(+end_at - distance);
|
||||
|
||||
const metrics = await getWebsiteStats(websiteUuid, {
|
||||
const metrics = await getWebsiteStats(websiteId, {
|
||||
start_at: startDate,
|
||||
end_at: endDate,
|
||||
filters: {
|
||||
|
|
@ -34,7 +33,7 @@ export default async (req, res) => {
|
|||
country,
|
||||
},
|
||||
});
|
||||
const prevPeriod = await getWebsiteStats(websiteUuid, {
|
||||
const prevPeriod = await getWebsiteStats(websiteId, {
|
||||
start_at: prevStartDate,
|
||||
end_at: prevEndDate,
|
||||
filters: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue