W n8n attention vm

This commit is contained in:
alma 2025-05-24 18:09:22 +02:00
parent 1bb2c8b17a
commit 03eafa5588

View File

@ -231,6 +231,12 @@ export async function POST(request: Request) {
// Only create mission in database after n8n succeeds // Only create mission in database after n8n succeeds
try { try {
console.log('Creating mission with data:', {
name: body.name,
logoPath: body.logoPath,
logo: body.logo
});
const missionData = { const missionData = {
name: body.name, name: body.name,
oddScope: body.oddScope, oddScope: body.oddScope,
@ -243,13 +249,20 @@ export async function POST(request: Request) {
profils: body.profils, profils: body.profils,
participation: body.participation, participation: body.participation,
creatorId: userId, 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({ const mission = await prisma.mission.create({
data: missionData data: missionData
}); });
console.log('Mission created with logo:', {
missionId: mission.id,
logo: mission.logo
});
return NextResponse.json({ return NextResponse.json({
success: true, success: true,
mission, mission,