W n8n attention vm
This commit is contained in:
parent
03eafa5588
commit
ea96b1d416
@ -231,10 +231,22 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
// Only create mission in database after n8n succeeds
|
// Only create mission in database after n8n succeeds
|
||||||
try {
|
try {
|
||||||
|
// Log the entire workflow result
|
||||||
|
console.log('N8N Workflow Result:', JSON.stringify(workflowResult, null, 2));
|
||||||
|
|
||||||
|
// Extract logo path from workflow result
|
||||||
|
let logoPath = null;
|
||||||
|
if (workflowResult.data && Array.isArray(workflowResult.data)) {
|
||||||
|
const firstResult = workflowResult.data[0];
|
||||||
|
if (firstResult && firstResult.logoPath) {
|
||||||
|
logoPath = firstResult.logoPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Creating mission with data:', {
|
console.log('Creating mission with data:', {
|
||||||
name: body.name,
|
name: body.name,
|
||||||
logoPath: body.logoPath,
|
logoPath,
|
||||||
logo: body.logo
|
workflowResult: workflowResult
|
||||||
});
|
});
|
||||||
|
|
||||||
const missionData = {
|
const missionData = {
|
||||||
@ -249,7 +261,7 @@ export async function POST(request: Request) {
|
|||||||
profils: body.profils,
|
profils: body.profils,
|
||||||
participation: body.participation,
|
participation: body.participation,
|
||||||
creatorId: userId,
|
creatorId: userId,
|
||||||
logo: body.logoPath ? `missions/${body.logoPath}` : null // Ensure proper path format
|
logo: logoPath ? `missions/${logoPath}` : null
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('Mission data to be saved:', missionData);
|
console.log('Mission data to be saved:', missionData);
|
||||||
@ -260,7 +272,8 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
console.log('Mission created with logo:', {
|
console.log('Mission created with logo:', {
|
||||||
missionId: mission.id,
|
missionId: mission.id,
|
||||||
logo: mission.logo
|
logo: mission.logo,
|
||||||
|
fullMission: mission
|
||||||
});
|
});
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user