mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
update schema validation for link/pixel updates
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
This commit is contained in:
parent
dfe969cabe
commit
504c459090
2 changed files with 5 additions and 5 deletions
|
|
@ -24,9 +24,9 @@ export async function GET(request: Request, { params }: { params: Promise<{ link
|
|||
|
||||
export async function POST(request: Request, { params }: { params: Promise<{ linkId: string }> }) {
|
||||
const schema = z.object({
|
||||
name: z.string(),
|
||||
url: z.string(),
|
||||
slug: z.string(),
|
||||
name: z.string().optional(),
|
||||
url: z.string().optional(),
|
||||
slug: z.string().min(8).optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ export async function GET(request: Request, { params }: { params: Promise<{ pixe
|
|||
|
||||
export async function POST(request: Request, { params }: { params: Promise<{ pixelId: string }> }) {
|
||||
const schema = z.object({
|
||||
name: z.string(),
|
||||
slug: z.string().min(8),
|
||||
name: z.string().optional(),
|
||||
slug: z.string().min(8).optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue