W n8n rest
This commit is contained in:
parent
89788e409e
commit
8739fb5de0
@ -378,18 +378,7 @@ export function MissionsAdminPanel() {
|
||||
|
||||
// Handle mission submission
|
||||
const handleSubmitMission = async () => {
|
||||
console.log('Starting mission submission...');
|
||||
console.log('Current mission data:', JSON.stringify(missionData, null, 2));
|
||||
console.log('Selected services:', selectedServices);
|
||||
console.log('Guardians:', {
|
||||
gardienDuTemps,
|
||||
gardienDeLaParole,
|
||||
gardienDeLaMemoire
|
||||
});
|
||||
console.log('Volunteers:', volontaires);
|
||||
|
||||
if (!validateMission()) {
|
||||
console.log('Mission validation failed');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -413,8 +402,10 @@ export function MissionsAdminPanel() {
|
||||
'gardien-memoire': gardienDeLaMemoire
|
||||
},
|
||||
volunteers: volontaires,
|
||||
logo: selectedLogoFile,
|
||||
attachments: selectedAttachments
|
||||
// Only include logo if it exists and has a path
|
||||
logo: missionData.logo || null,
|
||||
// Don't send attachments directly - they should be handled separately
|
||||
attachments: undefined
|
||||
};
|
||||
|
||||
console.log('Submitting mission data:', JSON.stringify(formattedData, null, 2));
|
||||
@ -427,13 +418,21 @@ export function MissionsAdminPanel() {
|
||||
body: JSON.stringify(formattedData),
|
||||
});
|
||||
|
||||
console.log('Response status:', response.status);
|
||||
const data = await response.json();
|
||||
console.log('Response data:', JSON.stringify(data, null, 2));
|
||||
console.log('Response status:', response.status);
|
||||
console.log('Response data:', data);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error('Error response:', data);
|
||||
throw new Error(data.error || 'Failed to create mission');
|
||||
throw new Error(data.error || data.details || 'Failed to create mission');
|
||||
}
|
||||
|
||||
// Handle file uploads after mission creation if needed
|
||||
if (selectedLogoFile || selectedAttachments.length > 0) {
|
||||
// TODO: Implement file upload handling
|
||||
console.log('Files to be uploaded:', {
|
||||
logo: selectedLogoFile,
|
||||
attachments: selectedAttachments
|
||||
});
|
||||
}
|
||||
|
||||
toast({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user