feat(import): enhance image URL extraction and logging during recipe import

This commit is contained in:
Nils-Johan Gynther
2026-04-22 22:08:05 +02:00
parent 28606d7abd
commit 71bc162015
8 changed files with 163 additions and 21 deletions
@@ -19,6 +19,22 @@ export const POST = withAuth(async (request, session) => {
});
const text = await response.text();
try {
const parsed = JSON.parse(text);
// eslint-disable-next-line no-console
console.log('[QuickImportProxy] backend response', {
status: response.status,
hasMarkdown: Boolean(parsed?.markdown),
imageUrl: parsed?.imageUrl ?? null,
imageWarning: parsed?.imageWarning ?? null,
});
} catch {
// eslint-disable-next-line no-console
console.log('[QuickImportProxy] backend non-json response', {
status: response.status,
contentType: response.headers.get('content-type'),
});
}
return new NextResponse(text, {
status: response.status,
headers: { 'Content-Type': response.headers.get('content-type') ?? 'application/json' },