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