mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 10:05:36 +01:00
Merge branch 'dev' into jajaja
# Conflicts: # db/mysql/schema.prisma # package.json # pnpm-lock.yaml # src/app/(main)/reports/[reportId]/ReportBody.tsx # src/app/(main)/reports/[reportId]/ReportPage.tsx # src/app/(main)/reports/utm/UTMView.tsx # src/app/(main)/websites/[websiteId]/WebsiteMetricsBar.tsx # src/app/(main)/websites/[websiteId]/WebsiteTableView.tsx # src/app/(main)/websites/[websiteId]/events/EventsPage.tsx # src/app/api/reports/[reportId]/route.ts # src/app/api/websites/[websiteId]/metrics/route.ts # src/components/hooks/queries/useReport.ts # src/components/icons.ts # src/components/messages.ts # src/components/metrics/MetricsTable.module.css # src/components/metrics/MetricsTable.tsx # src/queries/sql/events/getEventMetrics.ts # src/queries/sql/reports/getUTM.ts
This commit is contained in:
commit
45c9ea9c22
28 changed files with 571 additions and 139 deletions
|
|
@ -13,7 +13,12 @@ import {
|
|||
} from '@/lib/constants';
|
||||
import { parseRequest, getQueryFilters } from '@/lib/request';
|
||||
import { json, unauthorized, badRequest } from '@/lib/response';
|
||||
import { getPageviewMetrics, getSessionMetrics, getChannelMetrics } from '@/queries';
|
||||
import {
|
||||
getEventMetrics,
|
||||
getPageviewMetrics,
|
||||
getSessionMetrics,
|
||||
getChannelMetrics,
|
||||
} from '@/queries';
|
||||
import { dateRangeParams, filterParams, searchParams } from '@/lib/schema';
|
||||
|
||||
export async function GET(
|
||||
|
|
@ -71,7 +76,13 @@ export async function GET(
|
|||
}
|
||||
|
||||
if (EVENT_COLUMNS.includes(type)) {
|
||||
const data = await getPageviewMetrics(websiteId, { type, limit, offset }, filters);
|
||||
let data;
|
||||
|
||||
if (type === 'event') {
|
||||
data = await getEventMetrics(websiteId, { type, limit, offset }, filters);
|
||||
} else {
|
||||
data = await getPageviewMetrics(websiteId, { type, limit, offset }, filters);
|
||||
}
|
||||
|
||||
return json(data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue