mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
New admin section.
This commit is contained in:
parent
cdf391d5c2
commit
b78ff3b477
28 changed files with 161 additions and 100 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import { z } from 'zod';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
import { getUserWebsites } from '@/queries/prisma/website';
|
||||
import { pagingParams } from '@/lib/schema';
|
||||
import { getQueryFilters, parseRequest } from '@/lib/request';
|
||||
import { pagingParams, searchParams } from '@/lib/schema';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
|
||||
export async function GET(request: Request, { params }: { params: Promise<{ userId: string }> }) {
|
||||
const schema = z.object({
|
||||
...pagingParams,
|
||||
...searchParams,
|
||||
});
|
||||
|
||||
const { auth, query, error } = await parseRequest(request, schema);
|
||||
|
|
@ -21,9 +22,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ user
|
|||
return unauthorized();
|
||||
}
|
||||
|
||||
const filters = await getQueryFilters(query);
|
||||
|
||||
const websites = await getUserWebsites(userId, filters);
|
||||
const websites = await getUserWebsites(userId, query);
|
||||
|
||||
return json(websites);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue