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 }) } }