W n8n attention vm
This commit is contained in:
parent
503afb99f9
commit
c0bbcba507
@ -246,6 +246,15 @@ export async function POST(request: Request) {
|
|||||||
const firstResult = workflowResult.results[0];
|
const firstResult = workflowResult.results[0];
|
||||||
console.log('First result from workflow:', JSON.stringify(firstResult, null, 2));
|
console.log('First result from workflow:', JSON.stringify(firstResult, null, 2));
|
||||||
|
|
||||||
|
// Check if the result is HTML (error case)
|
||||||
|
if (typeof firstResult === 'string' && firstResult.includes('<!DOCTYPE html>')) {
|
||||||
|
console.error('Received HTML response instead of JSON:', firstResult);
|
||||||
|
return NextResponse.json({
|
||||||
|
error: 'Invalid response from workflow',
|
||||||
|
details: 'Received HTML instead of JSON data'
|
||||||
|
}, { status: 500 });
|
||||||
|
}
|
||||||
|
|
||||||
if (firstResult && firstResult.json && firstResult.json.logoPath) {
|
if (firstResult && firstResult.json && firstResult.json.logoPath) {
|
||||||
logoPath = firstResult.json.logoPath;
|
logoPath = firstResult.json.logoPath;
|
||||||
console.log('Extracted logo path:', logoPath);
|
console.log('Extracted logo path:', logoPath);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user