mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 05:37:20 +01:00
Fixed resetAt lookup. Added teams GET.
This commit is contained in:
parent
5244d8608b
commit
d0aa266dce
2 changed files with 24 additions and 5 deletions
|
|
@ -3,8 +3,27 @@ import { getRandomChars } from '@/lib/generate';
|
|||
import { unauthorized, json } from '@/lib/response';
|
||||
import { canCreateTeam } from '@/permissions';
|
||||
import { uuid } from '@/lib/crypto';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { createTeam } from '@/queries/prisma';
|
||||
import { getQueryFilters, parseRequest } from '@/lib/request';
|
||||
import { createTeam, getUserTeams } from '@/queries/prisma';
|
||||
import { pagingParams } from '@/lib/schema';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const schema = z.object({
|
||||
...pagingParams,
|
||||
});
|
||||
|
||||
const { auth, query, error } = await parseRequest(request, schema);
|
||||
|
||||
if (error) {
|
||||
return error();
|
||||
}
|
||||
|
||||
const filters = await getQueryFilters(query);
|
||||
|
||||
const teams = await getUserTeams(auth.user.id, filters);
|
||||
|
||||
return json(teams);
|
||||
}
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const schema = z.object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue