mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Fixed queries again.
This commit is contained in:
parent
fc640ff394
commit
1ba28ece8b
8 changed files with 26 additions and 21 deletions
|
|
@ -2,7 +2,7 @@ import { z } from 'zod';
|
|||
import { canViewWebsite } from '@/lib/auth';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { getGoals } from '@/queries/analytics/reports/getGoals';
|
||||
import { getGoals } from '@/queries/sql/reports/getGoals';
|
||||
import { reportParms } from '@/lib/schema';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { canViewWebsite } from '@/lib/auth';
|
|||
import { unauthorized, json } from '@/lib/response';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { reportParms, timezoneParam } from '@/lib/schema';
|
||||
import { getRevenue } from '@/queries/analytics/reports/getRevenue';
|
||||
import { getRevenueValues } from '@/queries/analytics/reports/getRevenueValues';
|
||||
import { getRevenue } from '@/queries/sql/reports/getRevenue';
|
||||
import { getRevenueValues } from '@/queries/sql/reports/getRevenueValues';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { auth, query, error } = await parseRequest(request);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { z } from 'zod';
|
||||
import { json, unauthorized } from '@/lib/response';
|
||||
import { getAllUserWebsitesIncludingTeamOwner } from '@/queries/prisma/website';
|
||||
import { getEventUsage } from '@/queries/analytics/events/getEventUsage';
|
||||
import { getEventDataUsage } from '@/queries/analytics/events/getEventDataUsage';
|
||||
import { getEventUsage } from '@/queries/sql/events/getEventUsage';
|
||||
import { getEventDataUsage } from '@/queries/sql/events/getEventDataUsage';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
|
||||
export async function GET(request: Request, { params }: { params: Promise<{ userId: string }> }) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { z } from 'zod';
|
|||
import { parseRequest } from '@/lib/request';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
import { canViewWebsite } from '@/lib/auth';
|
||||
import { getEventDataEvents } from '@/queries/analytics/events/getEventDataEvents';
|
||||
import { getEventDataEvents } from '@/queries/sql/events/getEventDataEvents';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { canViewWebsite } from '@/lib/auth';
|
|||
import { SESSION_COLUMNS, EVENT_COLUMNS, FILTER_COLUMNS, OPERATORS } from '@/lib/constants';
|
||||
import { getRequestFilters, getRequestDateRange, parseRequest } from '@/lib/request';
|
||||
import { json, unauthorized, badRequest } from '@/lib/response';
|
||||
import { getPageviewMetrics, getSessionMetrics } from '@/queries';
|
||||
import { getPageviewMetrics, getSessionMetrics, getChannelMetrics } from '@/queries';
|
||||
import { filterParams } from '@/lib/schema';
|
||||
|
||||
export async function GET(
|
||||
|
|
@ -78,5 +78,11 @@ export async function GET(
|
|||
return json(data);
|
||||
}
|
||||
|
||||
if (type === 'channel') {
|
||||
const data = await getChannelMetrics(websiteId, filters);
|
||||
|
||||
return json(data);
|
||||
}
|
||||
|
||||
return badRequest();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { z } from 'zod';
|
|||
import { parseRequest } from '@/lib/request';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
import { canViewWebsite } from '@/lib/auth';
|
||||
import { getEventDataEvents } from '@/queries/analytics/events/getEventDataEvents';
|
||||
import { getEventDataEvents } from '@/queries/sql/events/getEventDataEvents';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue