mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 13:05:36 +01:00
Convert event-data, events, session-data, sessions routes.
This commit is contained in:
parent
baa3851fb4
commit
7d5556a637
47 changed files with 692 additions and 136 deletions
|
|
@ -0,0 +1,20 @@
|
|||
import { unauthorized, json } from 'lib/response';
|
||||
import { canViewWebsite, checkAuth } from 'lib/auth';
|
||||
import { getWebsiteSession } from 'queries';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ websiteId: string; sessionId: string }> },
|
||||
) {
|
||||
const { websiteId, sessionId } = await params;
|
||||
|
||||
const auth = await checkAuth(request);
|
||||
|
||||
if (!auth || !(await canViewWebsite(auth, websiteId))) {
|
||||
return unauthorized();
|
||||
}
|
||||
|
||||
const data = await getWebsiteSession(websiteId, sessionId);
|
||||
|
||||
return json(data);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue