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:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user