feat(import): enhance image URL extraction and logging during recipe import
This commit is contained in:
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user