From 949d7c60b956ebcbb65b092889dc6e2df4992070 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 24 Jun 2026 18:01:56 +0200 Subject: [PATCH] debug: log product search result to trace not_found issues Co-Authored-By: Claude Sonnet 4.6 --- src/app/api/products/search/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/api/products/search/route.ts b/src/app/api/products/search/route.ts index 17a9b65..3ab1780 100644 --- a/src/app/api/products/search/route.ts +++ b/src/app/api/products/search/route.ts @@ -10,9 +10,11 @@ export async function GET(req: NextRequest) { try { const result = await searchProductByRef(ref.trim()) + console.log(`[search] ref="${ref.trim()}" → found=${result.found} id=${(result as {shopifyId?: string}).shopifyId ?? '-'}`) return NextResponse.json(result) } catch (err) { const message = err instanceof Error ? err.message : 'Erreur inconnue' + console.error(`[search] ref="${ref.trim()}" → ERROR: ${message}`) return NextResponse.json({ error: message }, { status: 500 }) } }