diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 3d23ffd..2397c91 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -165,7 +165,8 @@ "Bash(git commit -m 'Revert: Remove loading spinner - was slowing down page *)", "Bash(git commit -m 'Fix: Show approved designs in customer account so they can order *)", "Bash(git commit -m 'Fix: Link approved designs to review page, not personalization *)", - "Bash(git commit -m 'Feat: Show estimated delivery date on design review page *)" + "Bash(git commit -m 'Feat: Show estimated delivery date on design review page *)", + "Bash(git commit -m 'Fix: Approve & Add to Bag button not working *)" ] } } diff --git a/src/app/designs/[id]/review/page.tsx b/src/app/designs/[id]/review/page.tsx index bfecbf4..90ca3d6 100644 --- a/src/app/designs/[id]/review/page.tsx +++ b/src/app/designs/[id]/review/page.tsx @@ -44,7 +44,11 @@ export default function DesignReviewPage({ params }: { params: { id: string } }) if (!design) return; setApproving(true); try { - const res = await fetch(`/api/designs/${params.id}/approve`, { method: 'POST' }); + const res = await fetch(`/api/designs/${params.id}/approve`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({}), + }); if (res.ok) { const updated = await res.json(); setDesign(updated); @@ -70,7 +74,12 @@ export default function DesignReviewPage({ params }: { params: { id: string } }) }); alert('Design approved! Added to your bag.'); + } else { + alert('Failed to approve design. Please try again.'); } + } catch (error) { + console.error('Error approving design:', error); + alert('An error occurred. Please try again.'); } finally { setApproving(false); }