debug: log product search result to trace not_found issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 18:01:56 +02:00
parent 36447a5c8c
commit 949d7c60b9
+2
View File
@@ -10,9 +10,11 @@ export async function GET(req: NextRequest) {
try { try {
const result = await searchProductByRef(ref.trim()) 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) return NextResponse.json(result)
} catch (err) { } catch (err) {
const message = err instanceof Error ? err.message : 'Erreur inconnue' const message = err instanceof Error ? err.message : 'Erreur inconnue'
console.error(`[search] ref="${ref.trim()}" → ERROR: ${message}`)
return NextResponse.json({ error: message }, { status: 500 }) return NextResponse.json({ error: message }, { status: 500 })
} }
} }