diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 51f6a06..6ea4998 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -71,7 +71,8 @@ "Bash(git commit -m 'Fix: Show personalised price on design review page *)", "Bash(git commit -m 'Fix: Safely parse designJson in admin order detail page *)", "Bash(xargs grep -l \"design-spec\")", - "Bash(git commit -m 'Improve: Design specification sheet now shows previews and info *)" + "Bash(git commit -m 'Improve: Design specification sheet now shows previews and info *)", + "Bash(git commit -m 'Fix: Handle undefined designElements in design spec SVG rendering *)" ] } } diff --git a/src/app/api/orders/[id]/design-spec/route.ts b/src/app/api/orders/[id]/design-spec/route.ts index bed27ce..fb72231 100644 --- a/src/app/api/orders/[id]/design-spec/route.ts +++ b/src/app/api/orders/[id]/design-spec/route.ts @@ -126,10 +126,10 @@ export async function GET(req: Request, { params }: { params: { id: string } }) Y (0cm) - ${designElements.map((el, idx) => ` + ${designElements && designElements.length > 0 ? designElements.map((el, idx) => ` E${idx + 1} - `).join('')} + `).join('') : ''}