From d1f09f91f055cd341188968493a327f913696ac7 Mon Sep 17 00:00:00 2001 From: Andymick Date: Sun, 19 Jul 2026 12:29:54 +0100 Subject: [PATCH] Fix: Include imageUrl/imageUrlBack in database select query - Previous optimization only selected colorPhotos fields - But the code checks existing.imageUrl to decide if print area should update - imageUrl/imageUrlBack were undefined, breaking the print area update logic - Now properly includes these fields in the select so the check works --- .claude/settings.local.json | 3 ++- src/app/admin/products/actions.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 064707f..338946f 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -106,7 +106,8 @@ "Bash(git commit -m 'Refactor: Move image display into PhotoPrintAreaField component *)", "Bash(git commit -m 'Optimize: Skip color photo processing when not uploading new photos *)", "Bash(git commit -m 'Optimize: Fetch only necessary fields from database *)", - "Bash(git commit -m 'Fix: Always update print area coordinates when editing product *)" + "Bash(git commit -m 'Fix: Always update print area coordinates when editing product *)", + "Bash(git commit -m 'Fix: Include imageUrl/imageUrlBack in database select query *)" ] } } diff --git a/src/app/admin/products/actions.ts b/src/app/admin/products/actions.ts index e0f9139..e9d8f35 100644 --- a/src/app/admin/products/actions.ts +++ b/src/app/admin/products/actions.ts @@ -206,6 +206,8 @@ export async function updateProduct(formData: FormData) { select: { colorPhotos: true, colorPhotosBack: true, + imageUrl: true, + imageUrlBack: true, }, }); if (!existing) throw new Error('Product not found.');