(request: Request, { params }: { params: Promise<{ pixelId: string }> })
| 5 | import { deletePixel, getPixel, updatePixel } from '@/queries/prisma'; |
| 6 | |
| 7 | export 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 | |
| 25 | export async function POST(request: Request, { params }: { params: Promise<{ pixelId: string }> }) { |
| 26 | const schema = z.object({ |
nothing calls this directly
no test coverage detected