W n8n
This commit is contained in:
parent
de8a550fc0
commit
7a5e68f0c8
@ -296,7 +296,44 @@ export async function POST(request: Request) {
|
||||
}, { status: 500 });
|
||||
}
|
||||
|
||||
return NextResponse.json(workflowResult);
|
||||
// Process the workflow result
|
||||
const results = workflowResult.results || {};
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
status: 'success',
|
||||
message: 'Mission created successfully',
|
||||
mission: {
|
||||
name: n8nData.name,
|
||||
oddScope: n8nData.oddScope,
|
||||
niveau: n8nData.niveau,
|
||||
intention: n8nData.intention,
|
||||
missionType: n8nData.missionType,
|
||||
donneurDOrdre: n8nData.donneurDOrdre,
|
||||
projection: n8nData.projection,
|
||||
services: n8nData.services,
|
||||
profils: n8nData.profils,
|
||||
participation: n8nData.participation,
|
||||
creatorId: n8nData.creatorId,
|
||||
logo: n8nData.logo,
|
||||
leantimeProjectId: results.leantimeProjectId,
|
||||
outlineCollectionId: results.outlineCollectionId,
|
||||
rocketChatChannelId: results.rocketChatChannelId,
|
||||
giteaRepositoryUrl: results.giteaRepositoryUrl,
|
||||
penpotProjectId: results.penpotProjectId
|
||||
},
|
||||
integrationStatus: {
|
||||
gitRepo: !!results.giteaRepositoryUrl,
|
||||
leantimeProject: !!results.leantimeProjectId,
|
||||
docCollection: !!results.outlineCollectionId,
|
||||
rocketChatChannel: !!results.rocketChatChannelId
|
||||
},
|
||||
resourceStatus: {
|
||||
gitRepo: !!results.giteaRepositoryUrl,
|
||||
leantimeProject: !!results.leantimeProjectId,
|
||||
docCollection: !!results.outlineCollectionId,
|
||||
rocketChatChannel: !!results.rocketChatChannelId
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error triggering n8n workflow:', error);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user