mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
clean-up hooks for passing uneccessary date params
This commit is contained in:
parent
06230ad2e9
commit
b7747b33e4
4 changed files with 20 additions and 8 deletions
|
|
@ -3,6 +3,7 @@ import { parseRequest } from '@/lib/request';
|
|||
import { badRequest, json, ok, unauthorized } from '@/lib/response';
|
||||
import { deleteTeamUser, getTeamUser, updateTeamUser } from '@/queries/prisma';
|
||||
import { z } from 'zod';
|
||||
import { teamRoleParam } from '@/lib/schema';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
|
|
@ -30,7 +31,7 @@ export async function POST(
|
|||
{ params }: { params: Promise<{ teamId: string; userId: string }> },
|
||||
) {
|
||||
const schema = z.object({
|
||||
role: z.string().regex(/team-member|team-view-only|team-manager/),
|
||||
role: teamRoleParam,
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ export async function GET(
|
|||
{ params }: { params: Promise<{ websiteId: string }> },
|
||||
) {
|
||||
const schema = z.object({
|
||||
compare: z.string().optional(),
|
||||
...dateRangeParams,
|
||||
...filterParams,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue