diff --git a/app/api/missions/route.ts b/app/api/missions/route.ts index 013c1536..0314cd86 100644 --- a/app/api/missions/route.ts +++ b/app/api/missions/route.ts @@ -255,9 +255,15 @@ export async function POST(request: Request) { }, { status: 500 }); } - if (firstResult && firstResult.json && firstResult.json.logoPath) { - logoPath = firstResult.json.logoPath; - console.log('Extracted logo path:', logoPath); + // Get logo path from the nested structure + if (firstResult?.integrationResults?.uploadResults?.logoPath) { + logoPath = firstResult.integrationResults.uploadResults.logoPath; + console.log('Extracted logo path from uploadResults:', logoPath); + } else if (firstResult?.logoPath) { + logoPath = firstResult.logoPath; + console.log('Extracted logo path from root:', logoPath); + } else { + console.log('No logo path found in result:', firstResult); } }