Fixed queries again.

This commit is contained in:
Mike Cao 2025-02-06 11:22:00 -08:00
parent fc640ff394
commit 1ba28ece8b
8 changed files with 26 additions and 21 deletions

View file

@ -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();
}