This commit is contained in:
alma 2025-05-23 11:38:27 +02:00
parent 7298d246c1
commit 7c08add31f
4 changed files with 939 additions and 277 deletions

BIN
.DS_Store vendored

Binary file not shown.

File diff suppressed because one or more lines are too long

937
My_workflow_43.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -140,7 +140,7 @@ export async function POST(request: Request) {
}, { status: 400 });
}
// Verify that the creator exists
// Verify that the creator exists BEFORE triggering n8n workflow
const creator = await prisma.user.findUnique({
where: { id: userId }
});
@ -217,7 +217,7 @@ export async function POST(request: Request) {
profils: Array.isArray(body.profils) ? body.profils : [],
guardians: body.guardians || {},
volunteers: Array.isArray(body.volunteers) ? body.volunteers : [],
creatorId: userId,
creatorId: userId, // Use the verified userId
config: {
N8N_API_KEY: process.env.N8N_API_KEY,
MISSION_API_URL: process.env.NEXT_PUBLIC_API_URL || 'https://api.slm-lab.net/api'