MCPcopy
hub / github.com/umami-software/umami / GET

Function GET

src/app/api/pixels/[pixelId]/route.ts:7–23  ·  view source on GitHub ↗
(request: Request, { params }: { params: Promise<{ pixelId: string }> })

Source from the content-addressed store, hash-verified

5import { deletePixel, getPixel, updatePixel } from '@/queries/prisma';
6
7export async function GET(request: Request, { params }: { params: Promise<{ pixelId: string }> }) {
8 const { auth, error } = await parseRequest(request);
9
10 if (error) {
11 return error();
12 }
13
14 const { pixelId } = await params;
15
16 if (!(await canViewPixel(auth, pixelId))) {
17 return unauthorized();
18 }
19
20 const pixel = await getPixel(pixelId);
21
22 return json(pixel);
23}
24
25export async function POST(request: Request, { params }: { params: Promise<{ pixelId: string }> }) {
26 const schema = z.object({

Callers

nothing calls this directly

Calls 6

parseRequestFunction · 0.90
canViewPixelFunction · 0.90
unauthorizedFunction · 0.90
getPixelFunction · 0.90
jsonFunction · 0.90
errorFunction · 0.85

Tested by

no test coverage detected