- Add DesignApproval and DesignApprovalMessage models for design review workflow - Add design approval admin interface (list, detail, chat, approve/reject) - Add per-image dimension tracking to OrderItem - Add design submission API endpoint - Add AdminDesignEditor for admin-side design modifications - Add DesignApprovalChat component for customer-admin communication - Update design specification generation with image dimension details - Add design persistence across login with next parameter redirect - Add font properties UI with font size and color display Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
21 lines
586 B
TypeScript
21 lines
586 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { prisma } from '@/lib/prisma';
|
|
|
|
export async function GET() {
|
|
try {
|
|
const designs = await prisma.designApproval.findMany({
|
|
where: { status: 'PENDING' },
|
|
include: { product: true, messages: { orderBy: { createdAt: 'desc' }, take: 1 } },
|
|
orderBy: { createdAt: 'desc' },
|
|
});
|
|
|
|
return NextResponse.json(designs);
|
|
} catch (err) {
|
|
console.error('Error fetching pending designs:', err);
|
|
return NextResponse.json(
|
|
{ error: 'Failed to fetch pending designs' },
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|