mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
New admin section.
This commit is contained in:
parent
cdf391d5c2
commit
b78ff3b477
28 changed files with 161 additions and 100 deletions
|
|
@ -3,22 +3,9 @@ import { canCreateTeamWebsite, canCreateWebsite } from '@/lib/auth';
|
|||
import { json, unauthorized } from '@/lib/response';
|
||||
import { uuid } from '@/lib/crypto';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { createWebsite, getUserWebsites } from '@/queries';
|
||||
import { pagingParams } from '@/lib/schema';
|
||||
import { createWebsite } from '@/queries';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const schema = z.object({ ...pagingParams });
|
||||
|
||||
const { auth, query, error } = await parseRequest(request, schema);
|
||||
|
||||
if (error) {
|
||||
return error();
|
||||
}
|
||||
|
||||
const websites = await getUserWebsites(auth.user.id, query);
|
||||
|
||||
return json(websites);
|
||||
}
|
||||
export { GET } from '@/app/api/users/[userId]/websites/route';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const schema = z.object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue