n8n int cleaning

This commit is contained in:
alma 2025-05-18 08:52:14 +02:00
parent 39a6ca9cb3
commit 2d25992870
2 changed files with 21 additions and 2 deletions

View File

@ -378,7 +378,19 @@ export function MissionsAdminPanel() {
// Handle mission submission // Handle mission submission
const handleSubmitMission = async () => { const handleSubmitMission = async () => {
if (!validateMission()) return; console.log('Starting mission submission...');
console.log('Current mission data:', missionData);
console.log('Guardians:', {
gardienDuTemps,
gardienDeLaParole,
gardienDeLaMemoire
});
console.log('Volunteers:', volontaires);
if (!validateMission()) {
console.log('Mission validation failed');
return;
}
setIsSubmitting(true); setIsSubmitting(true);
try { try {
@ -406,7 +418,9 @@ export function MissionsAdminPanel() {
body: JSON.stringify(formattedData), body: JSON.stringify(formattedData),
}); });
console.log('Response status:', response.status);
const data = await response.json(); const data = await response.json();
console.log('Response data:', data);
if (!response.ok) { if (!response.ok) {
throw new Error(data.error || 'Failed to create mission'); throw new Error(data.error || 'Failed to create mission');

View File

@ -23,8 +23,13 @@ export class N8nService {
body: JSON.stringify(data), body: JSON.stringify(data),
}); });
console.log('Webhook response status:', response.status);
console.log('Webhook response headers:', Object.fromEntries(response.headers.entries()));
if (!response.ok) { if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`); const errorText = await response.text();
console.error('Webhook error response:', errorText);
throw new Error(`HTTP error! status: ${response.status}, body: ${errorText}`);
} }
const result = await response.json(); const result = await response.json();