import { NextResponse } from 'next/server';
import { prisma } from '@/lib/prisma';

export async function POST(_req: Request, { params }: { params: { id: string } }) {
  const proof = await prisma.designProof.findUnique({ where: { id: params.id } });
  if (!proof) {
    return NextResponse.json({ error: 'Not found' }, { status: 404 });
  }

  await prisma.designProof.update({
    where: { id: params.id },
    data: { status: 'APPROVED' },
  });

  return NextResponse.json({ ok: true });
}
