mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09: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
|
|
@ -5,12 +5,10 @@ import { checkAuth } from 'lib/auth';
|
|||
import { unauthorized, badRequest, json } from 'lib/response';
|
||||
import { checkRequest } from 'lib/request';
|
||||
|
||||
const schema = z.object({
|
||||
...pagingParams,
|
||||
});
|
||||
|
||||
export async function GET(request: Request, { params }: { params: Promise<{ userId: string }> }) {
|
||||
const { userId } = await params;
|
||||
const schema = z.object({
|
||||
...pagingParams,
|
||||
});
|
||||
|
||||
const { query, error } = await checkRequest(request, schema);
|
||||
|
||||
|
|
@ -18,6 +16,8 @@ export async function GET(request: Request, { params }: { params: Promise<{ user
|
|||
return badRequest(error);
|
||||
}
|
||||
|
||||
const { userId } = await params;
|
||||
|
||||
const auth = await checkAuth(request);
|
||||
|
||||
if (!auth || (!auth.user.isAdmin && (!userId || auth.user.id !== userId))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue