diff --git a/.claude/settings.local.json b/.claude/settings.local.json index d817368..2e39691 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -81,7 +81,8 @@ "Bash(git commit -m 'Fix: Refresh page after updating order tracking details *)", "Bash(git commit -m 'Fix: Remove function prop from client component *)", "Bash(git commit -m 'Fix: Import revalidatePath from correct module *)", - "Bash(git commit -m 'Fix: Route photo requests to design canvas instead of approval upload *)" + "Bash(git commit -m 'Fix: Route photo requests to design canvas instead of approval upload *)", + "Bash(git commit -m 'Fix: Pass photo request ID instead of data URL *)" ] } } diff --git a/src/app/admin/custom-requests/[id]/page.tsx b/src/app/admin/custom-requests/[id]/page.tsx index 006e523..8a66d7e 100644 --- a/src/app/admin/custom-requests/[id]/page.tsx +++ b/src/app/admin/custom-requests/[id]/page.tsx @@ -19,7 +19,7 @@ export default async function CustomRequestDetailPage({ params }: { params: { id const whatsappMessage = `Hi ${request.customerName}, thanks for sending over your photo for a ${request.product.name} — we're working on it!`; const designParams = new URLSearchParams({ - customPhoto: request.imageDataUrl, + customRequestId: request.id, }); return ( diff --git a/src/app/made-to-order/[slug]/page.tsx b/src/app/made-to-order/[slug]/page.tsx index 2c479ee..a4e377e 100644 --- a/src/app/made-to-order/[slug]/page.tsx +++ b/src/app/made-to-order/[slug]/page.tsx @@ -12,7 +12,7 @@ export default async function ProductDetailPage({ searchParams, }: { params: { slug: string }; - searchParams: { customPhoto?: string }; + searchParams: { customRequestId?: string }; }) { const activePromotions = await fetchActivePromotions(); @@ -27,9 +27,20 @@ export default async function ProductDetailPage({ }); const related = relatedRows.map((p) => toProductDTO(p, activePromotions)); + // Fetch custom photo from request if customRequestId is provided + let customPhoto: string | undefined; + if (searchParams.customRequestId) { + const customRequest = await prisma.customRequest.findUnique({ + where: { id: searchParams.customRequestId }, + }); + if (customRequest) { + customPhoto = customRequest.imageDataUrl; + } + } + return (
- + {related.length > 0 && (