From 03eafa55889e3e5ef7a1f2a0cf05562822bc9472 Mon Sep 17 00:00:00 2001 From: alma Date: Sat, 24 May 2025 18:09:22 +0200 Subject: [PATCH] W n8n attention vm --- app/api/missions/route.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/api/missions/route.ts b/app/api/missions/route.ts index c90db204..d4719b34 100644 --- a/app/api/missions/route.ts +++ b/app/api/missions/route.ts @@ -231,6 +231,12 @@ export async function POST(request: Request) { // Only create mission in database after n8n succeeds try { + console.log('Creating mission with data:', { + name: body.name, + logoPath: body.logoPath, + logo: body.logo + }); + const missionData = { name: body.name, oddScope: body.oddScope, @@ -243,13 +249,20 @@ export async function POST(request: Request) { profils: body.profils, participation: body.participation, creatorId: userId, - logo: body.logo + logo: body.logoPath ? `missions/${body.logoPath}` : null // Ensure proper path format }; + console.log('Mission data to be saved:', missionData); + const mission = await prisma.mission.create({ data: missionData }); + console.log('Mission created with logo:', { + missionId: mission.id, + logo: mission.logo + }); + return NextResponse.json({ success: true, mission,