mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
clean-up event/event-data endpoints. fix for expanded view for mobile
This commit is contained in:
parent
9df012084d
commit
a2b1089e62
8 changed files with 47 additions and 21 deletions
|
|
@ -19,7 +19,7 @@ export async function GET(
|
|||
return unauthorized();
|
||||
}
|
||||
|
||||
const data = await getEventData(eventId);
|
||||
const data = await getEventData(websiteId, eventId);
|
||||
|
||||
return json(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { getQueryFilters, parseRequest } from '@/lib/request';
|
|||
import { unauthorized, json } from '@/lib/response';
|
||||
import { canViewWebsite } from '@/permissions';
|
||||
import { getEventDataEvents } from '@/queries/sql/events/getEventDataEvents';
|
||||
import { filterParams } from '@/lib/schema';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
|
|
@ -12,6 +13,7 @@ export async function GET(
|
|||
startAt: z.coerce.number().int(),
|
||||
endAt: z.coerce.number().int(),
|
||||
event: z.string().optional(),
|
||||
...filterParams,
|
||||
});
|
||||
const { auth, query, error } = await parseRequest(request, schema);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
import { z } from 'zod';
|
||||
import { getQueryFilters, parseRequest } from '@/lib/request';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
import { json, unauthorized } from '@/lib/response';
|
||||
import { filterParams, pagingParams, searchParams } from '@/lib/schema';
|
||||
import { canViewWebsite } from '@/permissions';
|
||||
import { dateRangeParams, pagingParams, filterParams, searchParams } from '@/lib/schema';
|
||||
import { getWebsiteEvents } from '@/queries/sql';
|
||||
import { z } from 'zod';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ websiteId: string }> },
|
||||
) {
|
||||
const schema = z.object({
|
||||
...dateRangeParams,
|
||||
startAt: z.coerce.number().optional(),
|
||||
endAt: z.coerce.number().optional(),
|
||||
...filterParams,
|
||||
...pagingParams,
|
||||
...searchParams,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue