Pixel editing.

This commit is contained in:
Mike Cao
2025-08-15 13:04:13 -07:00
parent eabdd18604
commit d130242a0a
23 changed files with 72 additions and 49 deletions

View File

@@ -25,7 +25,6 @@ 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(),
url: z.string().url(),
slug: z.string().min(8),
});
@@ -36,14 +35,14 @@ export async function POST(request: Request, { params }: { params: Promise<{ pix
}
const { pixelId } = await params;
const { name, domain, shareId } = body;
const { name, slug } = body;
if (!(await canUpdatePixel(auth, pixelId))) {
return unauthorized();
}
try {
const pixel = await updatePixel(pixelId, { name, domain, shareId });
const pixel = await updatePixel(pixelId, { name, slug });
return Response.json(pixel);
} catch (e: any) {